// ajax	통신의 경우	exception 발생 시 에러 페이지 이동
var	errorPage =	context	+ "/error.jsp";

var	commonUtil = Class.create();
var	validationUtil = Class.create();
var	envUtil	= Class.create();
var	dwrInvokeUtil =	Class.create();
var	resizeIF = Class.create();
resizeIF = {
	initialize : function(id, min) {
		if(	min	== null)
			this.min = 100;
		else
			this.min = min;

		this.time =	null;
		this.id	= id;
		this.location =	'';
		this.height	= '';
		this.obj = this.id;
		this.body =	'';
		this.h = '';
		//this.min = 700;
		this.count = 0;
		this.resize();
	},
	resize : function(element, min)	{
		if(	min	== null)
			min	= 300;
		else
			min	= min;
		try	{
			obj	= $(element);
			var	body = obj.contentWindow.$$('BODY');
			body = body[0];
			var	h =	body.scrollHeight;
			obj.style.height = (h<min?min:h) + 'px';
		} catch(E) {
		 //	alert(element);
			//obj.style.height = min;
		}
		return;
	},
	adminResize	: function(element,	iframeId) {
		var	doc	= $(element);
		alert(doc);
		doc.style.top=0;
		doc.style.left=0;
		if(doc.offsetHeight	== 0){
		//	setTimeout("resizeIF.resize('iframeId')",1000);
		//	resizeIF.resize(iframeId);
		//	alert('null');
		} else {
			pageheight = doc.offsetHeight;
			pagewidth =	doc.offsetWidth;
//			alert(pageheight);
			parent.$(iframeId).style.height	= pageheight;
		//	parent.frames[iframeId].resizeTo(pagewidth,pageheight);
		}
  }

};
commonUtil.prototype = {
	// 생성자 Function
	initialize : function()	{
	},
	doCheckImage : function(file_name) {
		var	pathpoint =	file_name.lastIndexOf('.');
		var	filepoint =	file_name.substring(pathpoint+1	,file_name.length);
		var	filetype = filepoint.toLowerCase();
		if(filetype=='jpg' || filetype=='gif' || filetype=='png' ||	filetype=='jpeg' ||	filetype=='bmp') {
			return true;
		}else{
			alert('이미지 파일만 업로드 하실수 있습니다.');
			return false;
		}
	},
	doCheckImageSize : function(file_name,width,height,sizeW,sizeH)	{	// 선택파일의 경로를 분리하여 확장자를 구합니다.
		var	pathpoint =	file_name.lastIndexOf('.');
		var	filepoint =	file_name.substring(pathpoint+1	,file_name.length);
		var	filetype = filepoint.toLowerCase();
		var	wwd=width;	//제한할이미지가로사이즈
		var	hhd=height;	 //제한할이미지세로사이즈
		var	ImageWidth=sizeW; //이미지의가로사이즈체크
		var	ImageHeight=sizeH; //이미지의세로사이즈체크
		if(ImageWidth >	wwd){
			alert('첨부한 이미지의 가로사이즈는'+ImageWidth+'입니다.\n\n이미지의가로사이즈는'+wwd+'이하여야합니다.');
			return false;
		}
		if(ImageHeight > hhd){
			alert('첨부한 이미지의 세로사이즈는'+ImageHeight+'입니다.\n\n이미지의세로사이즈는'+hhd+'이하여야합니다.');
		return false;
		}
		if(filetype=='bmp')	{
			var upload = confirm('BMP 파일은 웹상에서 사용하기엔 적절한 이미지 포맷이 아닙니다.\n그래도 계속 하시겠습니까?');
			if(!upload)	return false;
		}

		return true;
	},
	changeStyle	: function(element)	{
		var	parentElement =	$(element).up().up();
		if (parentElement == undefined && parentElement.tagName	== "tr"	)
			return;
		if (element.checked)
			parentElement.className	= "selected";
		else
			parentElement.className	= "mouseover";
	},
	// checkbox	모두선택/해제 Function
	doCheckAll : function(form,	elemNm)	{
		var	chkNm =	"chk";
		if(	elemNm)
			chkNm =	elemNm;

		form = $( form);

		var	check_yn = "N";
		for( var i=0; i<form.elements.length; i++) {
			var	element	= form.elements[i];
			if(element.name	== chkNm) {
				if(	!element.disabled && !element.checked) {
					element.checked	= true;
					commUtil.changeStyle(element);
					check_yn = "Y";
				}
			}
		}
		if(	check_yn ==	"N") {
			for( var i=0; i<form.elements.length; i++) {
				var	element	= form.elements[i];
				if(element.name	== chkNm) {
					if(	!element.disabled && element.checked) {
						element.checked	= false;
						commUtil.changeStyle(element);
					}
				}
			}
		}
		return;
	},
	// checkbox	선택여부 체크
	doCheckDel : function(form,	userMessage) {
		form = $(form);

		var	messageString =	'message_009';
		if(userMessage != null)
			messageString =	userMessage;
		var	sel_count =	0;
		for( var i=0; i<form.elements.length; i++) {
		var	element	= form.elements[i];
		if(	element.name ==	'chk')
			if(	element.checked)
				sel_count= sel_count + 1;
		}

		if(sel_count ==	0) {
			alert(message.getMessageString('message_286'));
			return false;
		}
		else {
		   if(confirm(message.getMessageString(messageString)))	{
			   return true;
		   }
		}
		return false;
	},
	// checkbox	선택여부 체크
	doCheckUpd : function(form)	{
		form = $(form);

		var	sel_count =	0;
		for( var i=0; i<form.elements.length; i++) {
		var	element	= form.elements[i];
		if(	element.name ==	'chk')
			if(	element.checked)
				sel_count= sel_count + 1;
		}

		if(sel_count ==	0) {
			alert(message.getMessageString('message_364'));
			return false;
		}
		else {
		   if(confirm(message.getMessageString('message_024')))	{
			   return true;
		   }
		}
		return false;
	},
	// checkbox	선택여부 체크
	doCheckAdd : function(form)	{
		form = $(form);

		var	sel_count =	0;
		for( var i=0; i<form.elements.length; i++) {
		var	element	= form.elements[i];
		if(	element.name ==	'chk')
			if(	element.checked)
				sel_count= sel_count + 1;
		}

		if(sel_count ==	0) {
			alert(message.getMessageString('message_285'));
			return false;
		}
		else {
		   if(confirm(message.getMessageString('message_013')))	{
			   return true;
		   }
		}
		return false;
	},
	// checkbox	선택여부 체크
	doCheckItems : function(form, elemNm, actNm) {
		var	chkNm =	"chk";
		if(	elemNm)
			chkNm =	elemNm;

		form = $( form);

		var	sel_count =	0;
		for( var i=0; i<form.elements.length; i++) {
		var	element	= form.elements[i];
		if(	element.name ==	chkNm)
			if(	element.checked)
				sel_count= sel_count + 1;
		}

		if(	sel_count == 0)	{
			alert( actNm + "할 항목이 선택되지 않았습니다");
			return false;
		}
		else {
		   if( confirm(	actNm +	"하시겠습니까?")) {
			   return true;
		   }
		}
		return false;
	},

	// checkbox 선택여부 체크,,휴면 처리 시 사용
	doCheckDormancy	: function(form_name) {
		var	sel_count =	0;
		for( var i=0; i<form_name.elements.length; i++)	{
		var	element	= form_name.elements[i];
		if(	element.name ==	'chk')
			if(	element.checked){
				sel_count= sel_count + 1;
				status=element.getAttribute('value2');//가입상태 1:가입, 2:가입대기, 3:휴면, 4:탈퇴
				if(!(status==1 || status==2)){//가입,가입대기 인경우만 휴면	처리 가능.
					alert(message.getMessageString('message_348'));
					element.focus();
					return;
				}
			}
		}

		if(sel_count ==	0) {
			alert(message.getMessageString('message_293'));
			return false;
		}
		else {
		   if(confirm(message.getMessageString('message_015')))	{
			   return true;
		   }
		}
		return false;
	},

	// checkbox 선택여부 체크,,탈퇴 처리 시 사용
	doCheckSecede :	function(form_name)	{
		var	sel_count =	0;
		for( var i=0; i<form_name.elements.length; i++)	{
		var	element	= form_name.elements[i];
		if(	element.name ==	'chk')
			if(	element.checked){
				sel_count= sel_count + 1;
				status=element.getAttribute('value2');//가입상태 1:가입, 2:가입대기, 3:휴면, 4:탈퇴
				if(!(status==1 || status==2	|| status==3)){//가입,가입대기 인경우만	탈퇴처리 가능.
					alert(message.getMessageString('message_347'));
					element.focus();
					return;
				}
			}
		}
		if(sel_count ==	0) {
			alert(message.getMessageString('message_292'));
			return false;
		}
		else {
		   if(confirm(message.getMessageString('message_014')))	{
			   return true;
		   }
		}
		return false;
	},

	// checkbox	선택여부 체크,,	가입  처리 시 사용
	doCheckJoin	: function(form_name) {
		var	sel_count =	0;
		for( var i=0; i<form_name.elements.length; i++)	{
		var	element	= form_name.elements[i];
		if(	element.name ==	'chk')
			if(	element.checked){
				sel_count= sel_count + 1;
				status=element.getAttribute('value2');//가입상태 1:가입, 2:가입대기, 3:휴면, 4:탈퇴
				if(!(status==2)){//가입대기 인경우만 가입 처리 가능.
					alert(message.getMessageString('message_349'));
					element.focus();
					return;
				}
			}
		}
		if(sel_count ==	0) {
			alert(message.getMessageString('message_350'));
			return false;
		}
		else {
		   if(confirm(message.getMessageString('message_023')))	{
			   return true;
		   }
		}
		return false;
	},
	mouseOver :	function(object) {
		Element.setStyle(object, {"background-color" : "#EDEDED"});
	},
	mouseOut : function(object)	{
		Element.setStyle(object, {"background-color" : "#FFFFFF"});
	},
	getStringLength	: function(str)	{
		return(str.length+(escape(str)+"%u").match(/%u/g).length-1);
	},
	// 팝업윈도우1
	// 파라미터 1) 팝업윈도우명 2) URL 3) 창 가로크기 4) 창 세로크기
	// 사용예 :	popWindow('WIN', 'http://domain', 800, 600);
	popWindow :	function(objName, src, width, height) {
		var	lSize =	( screen.width - width ) / 2;
		var	tSize =	( screen.height	- height ) / 2;
		var	pWin = window.open(	src,
					objName,
					"top="+tSize+",left="+lSize+",status=no,toolbar=no,scrollbars=yes,resizable=yes,menubar=no,width="+width+",height="+height );

		eval(pWin).focus();
		return pWin;
	},
	// 팝업윈도우2
	// 파라미터 1) 팝업윈도우명 2) URL 3) 창 가로크기 4) 창 세로크기 5) 툴바 6) 스크롤바 7) 사이즈조절	
			// 사용예 :	popWindow('WIN', 'http://domain', 800, 600,	'yes', 'yes', 'yes');
	popWindow :	function(objName, src, width, height, toolbar, scrollbars, resizable) {
		var	lSize =	( screen.width - width ) / 2;
		var	tSize =	( screen.height	- height ) / 2;
		var	pWin = window.open(	src,
					objName,
					"top="+tSize+",left="+lSize+",status=no,toolbar="+toolbar+",scrollbars="+scrollbars+",resizable="+resizable+",menubar=no,width="+width+",height="+height );
		eval(pWin).focus();
		return pWin;
	},
	formToMap :	function( form)	{
		var	params = Form.serialize( form, true);
		return params;
	},
	loading	: function(){
		$('progress').style.left = (document.body.offsetWidth /	2 -	15)	+ 'px';
		$('progress').style.top	= (document.body.offsetHeight /	2 -	15)	+ 'px';

		$('progress').style.display	= "";

		this.imgs =	$$('IMG');
		this.loaded	= 0;

		for(n=0;n<this.imgs.length;n++)	this.check(n);

		commUtil.notifyMsg();
	},
	draw : function(){
		this.loaded++;
		if(this.imgs.length<=this.loaded) {
			setTimeout('Element.hide("progress");new Effect.Fade("progress");',	500);
		}
	},
	check :	function(n){
		(this.imgs[n].complete)? this.draw():setTimeout('this.check('+n+')', 10000);
	},
	//두 날짜의 선후를 비교해 순서가 바뀌었을 경우 경고창 띠운다
			check_date : function(as_date01, as_date02){
		var	d1 = commUtil.replace(as_date01,'-','0');
		var	d2 = commUtil.replace(as_date02,'-','0');

		if (parseInt(d1) > parseInt(d2)) {
			return false;
		}

		return true;
	},
	//String str 에서 문자 a를 찾아 b로 바꾼다	
			replace	: function(str,a,b){
		array =	new	Array(0);
		var	newString ='';
		var	orgString =	new	String(str);

		array =	orgString.split(a);

		for(i=0;i<array.length;i++){

			if(i!=array.length){
				newString+=array[i]+b;
			}else{
				newString+=array[i];
			}
		}

		return newString;
	},
	notifyMsg :	function()
	{
		if(getCookie("message_used") !=	null &&	getCookie("message_used") == "1" ){

			var	resultMsg =	getCookie("result_message");

			if(	resultMsg != null && resultMsg != "")
			{
				alert( resultMsg);
			}
		}
		setCookie( "message_used", []);
		setCookie( "result_message", []);
	},
	//상태에 따라서 입력폼을 없애거나 disable시키는 부분	
			disabledObjsos : function(varArr, frm)
	{
		for(i=0	; i<varArr.length ;	i++){
			var	str	= document.getElementsByName(varArr[i]);

			obj	= frm.elements[varArr[i]];

			if(str.length >	1){
				for(j=0;j<str.length;j++){
					commUtil.doDisable(obj[j]);
				}
			}else commUtil.doDisable(obj);
		}
	},
	doDisable :	function(obj)
	{
		if(obj.type	== 'text'){
			obj.readOnly  =	true;
		}  else if(obj.type	== 'select-one'){
			obj.disabled = true;
		} else if(obj.type	== 'textarea'){
			obj.readOnly = true;
		} else if(obj.type	== 'checkbox'){
			obj.disabled = true;
		} else if(obj.type	== 'radio'){
			obj.disabled = true;
		} else {
			Element.hide(obj);
		}
	},
	doEnable :	function(obj)
	{
		if(obj.type	== 'text'){
			obj.readOnly  =	false;
		}  else if(obj.type	== 'select-one'){
			obj.disabled = false;
		} else if(obj.type	== 'textarea'){
			obj.readOnly = false;
		} else if(obj.type	== 'checkbox'){
			obj.disabled = false;
		} else if(obj.type	== 'radio'){
			obj.disabled = false;
		} else {
			Element.show(obj);
		}
	},
	// 바이트값	얻기
	getByte	: function(val)
	{
		 var cnt = 0;
		 for (var i	= 0; i < val.length; i++) {
			 if	(val.charCodeAt(i) > 127)
				 cnt +=	2;
			 else
				 cnt++;
		 }
		 return	cnt;
	},
	//tab키 클릭시 포커스 이동 막기
	shortcutTab	: function(eleNm){
		var	default_options	= {
			'type':'keydown',
			'propagate':false,
			'target':document
		}
		var	opt	= default_options;
		var	ele	= opt.target
		if(typeof opt.target ==	'string') ele =	document.getElementById(opt.target);
		var	ths	= this;
		var	func = function(e) {
			e =	e || window.event;
			if (e.keyCode) code	= e.keyCode;
			else if	(e.which) code = e.which;

			if(	!e.shiftKey	&& code	== 9) {
				for	( i=0; i < eleNm.length; i++) {
					if(	Event.element(e).name == undefined || Event.element(e).name	== eleNm[i])
						e.returnValue =	false;
				}
			}
		}

		if(ele.addEventListener) ele.addEventListener(opt['type'], func, false);
		else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func);
		else ele['on'+opt['type']] = func;
	},
	//Shift+tab키 클릭시 포커스 이동 막기
	shortcutShiftTab : function(eleNm){
		var	default_options	= {
			'type':'keydown',
			'propagate':false,
			'target':document
		}
		var	opt	= default_options;
		var	ele	= opt.target
		if(typeof opt.target ==	'string') ele =	document.getElementById(opt.target);
		var	ths	= this;
		var	func = function(e) {
			e =	e || window.event;
			if (e.keyCode) code	= e.keyCode;
			else if	(e.which) code = e.which;

			if(	e.shiftKey && code == 9) {
				for	( i=0; i < eleNm.length; i++) {
					if(	Event.element(e).name == undefined || Event.element(e).name	== eleNm[i])
						e.returnValue =	false;
				}
			}
		}

		if(ele.addEventListener) ele.addEventListener(opt['type'], func, false);
		else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func);
		else ele['on'+opt['type']] = func;
	},
	activateControl	: function(	objID) {
		var	obj	= $(objID);
		var	tag	= obj.value;
		document.write(	tag);
		obj.value =	"";
	},
			getFrameWindow : function( frame) {
		frame =	$(frame);
		return frame.contentWindow;
	},
	checkDwrResult : function( result, succMsg,	nullMsg) {
		var	_result;
		if(	result)	{
			switch(	result)	{
				case 0 :
					alert( "해당 자료가	존재하지 않습니다.");
					break;
				case -98 :
					alert( "하위 데이터가 존재하므로 삭제할 수 없습니다.");
					break;
				case -99 :
					alert ("관련 정보가	존재하므로 삭제할 수 없습니다.");
					break;
				default	:
					if(	succMsg)	alert( succMsg);
					_result	= result;
					break;
			}
		}
		else if( nullMsg)	alert( nullMsg);

		return _result;
	},
	makeRequired1 : function( form, element, isRequired) {
		if (element.up() != null && element.up().previous() != null) {
  			var prevElement = element.up().previous();
  			
  			if (isRequired) {
  				if (prevElement != null && prevElement.tagName == "TH" && (prevElement.down('font', 0) == undefined || prevElement.down('font', 0).innerHTML != "* ") && prevElement.down('span', 0) == undefined) {
	   				prevElement.innerHTML = "<font color='#FF6600'>* </font>" + prevElement.innerHTML;
	   				Element.show(element)
	   				element.className += " required";
	   			}
	   			else
	   			{
	   				Element.show(element)
	   				element.className += " required";
	   			}
  			} else {
  				temp = prevElement.down("font", 0);
  				if (temp != undefined) 
  					Element.remove(temp);
  					
  				element.className = element.className.replace(" required", "");
  				element.value = "";
  				Element.hide(element);
  			}
		}
		
		validUtil.makeHelp( form);
	},
	makeRequired : function( form, element, isRequired, actionElements) {
		if (element.up() != null && element.up().previous() != null) {
  			var prevElement = element.up().previous();
  			
  			if (isRequired) {
  				if (prevElement != null && prevElement.tagName == "TH" && (prevElement.down('font', 0) == undefined || prevElement.down('font', 0).innerHTML != "* ") && prevElement.down('span', 0) == undefined) {
	   				prevElement.innerHTML = "<font color='#FF6600'>* </font>" + prevElement.innerHTML;
	   				this.doEnable(element);
	   		//		Element.show(element);
	   				if (actionElements != null) {
	   					for (var i = 0 ; i < actionElements.length ; i++) {
	   					//	Element.show(actionElements[i] );
	   						this.doEnable(actionElements[i]);
	   					}
	   				}
	   				element.className += " required";
	   			}
	   			else
	   			{
	   				this.doEnable(element);
	   				element.className += " required";
	   			}
  			} else {
  				temp = prevElement.down("font", 0);
  				if (temp != undefined) 
  					Element.remove(temp);
  					
  				element.className = element.className.replace(" required", "");
  				element.value = "";
  			//	Element.hide(element);
  				this.doDisable(element);
  				if (actionElements != null) {
   					for (var i = 0 ; i < actionElements.length ; i++) {
   					//	Element.hide(actionElements[i] );
   						this.doDisable(actionElements[i]);
   					}
   				}
  			}
		}
		
		validUtil.makeHelp( form);
	},
	getRadioValue : function(formName, element) {
		var radio = $(formName)[element];
		for (var i = 0 ; i < radio.length ; i++) 
       		if (radio[i].checked)
       			return radio[i].value
	}
}

var	shortcut = {
	'all_shortcuts':{},//All the shortcuts are stored in this array
	'add': function(shortcut_combination,callback,opt) {
		//Provide a	set	of default options
		var	default_options	= {
			'type':'keydown',
			'propagate':false,
			'disable_in_input':false,
			'target':document,
			'keycode':false
		}
		if(!opt) opt = default_options;
		else {
			for(var	dfo	in default_options)	{
				if(typeof opt[dfo] == 'undefined') opt[dfo]	= default_options[dfo];
			}
		}

		var	ele	= opt.target
		if(typeof opt.target ==	'string') ele =	document.getElementById(opt.target);
		var	ths	= this;
		shortcut_combination = shortcut_combination.toLowerCase();

		//The function to be called	at keypress
		var	func = function(e) {
			e =	e || window.event;

			if(opt['disable_in_input'])	{ //Don't enable shortcut keys in Input, Textarea fields
				var	element;
				if(e.target) element=e.target;
				else if(e.srcElement) element=e.srcElement;
				if(element.nodeType==3)	element=element.parentNode;

				if(element.tagName == 'INPUT' || element.tagName ==	'TEXTAREA')	return;
			}

			//Find Which key is	pressed
			if (e.keyCode) code	= e.keyCode;
			else if	(e.which) code = e.which;
			var	character =	String.fromCharCode(code).toLowerCase();

			if(code	== 188)	character=","; //If	the	user presses , when	the	type is	onkeydown
			if(code	== 190)	character="."; //If	the	user presses , when	the	type is	onkeydown

			var	keys = shortcut_combination.split("+");
			//Key Pressed -	counts the number of valid keypresses -	if it is same as the number	of keys, the shortcut function is invoked
			var	kp = 0;

			//Work around for stupid Shift key bug created by using	lowercase -	as a result	the	shift+num combination was broken
			var	shift_nums = {
				"`":"~",
				"1":"!",
				"2":"@",
				"3":"#",
				"4":"$",
				"5":"%",
				"6":"^",
				"7":"&",
				"8":"*",
				"9":"(",
				"0":")",
				"-":"_",
				"=":"+",
				";":":",
				"'":"\"",
				",":"<",
				".":">",
				"/":"?",
				"\\":"|"
			}
			//Special Keys - and their codes
			var	special_keys = {
				'esc':27,
				'escape':27,
				'tab':9,
				'space':32,
				'return':13,
				'enter':13,
				'backspace':8,

				'scrolllock':145,
				'scroll_lock':145,
				'scroll':145,
				'capslock':20,
				'caps_lock':20,
				'caps':20,
				'numlock':144,
				'num_lock':144,
				'num':144,

				'pause':19,
				'break':19,

				'insert':45,
				'home':36,
				'delete':46,
				'end':35,

				'pageup':33,
				'page_up':33,
				'pu':33,

				'pagedown':34,
				'page_down':34,
				'pd':34,

				'left':37,
				'up':38,
				'right':39,
				'down':40,

				'f1':112,
				'f2':113,
				'f3':114,
				'f4':115,
				'f5':116,
				'f6':117,
				'f7':118,
				'f8':119,
				'f9':120,
				'f10':121,
				'f11':122,
				'f12':123
			}

			var	modifiers =	{
				shift: { wanted:false, pressed:false},
				ctrl : { wanted:false, pressed:false},
				alt	 : { wanted:false, pressed:false},
				meta : { wanted:false, pressed:false}	//Meta is Mac specific
			};

			if(e.ctrlKey)	modifiers.ctrl.pressed = true;
			if(e.shiftKey)	modifiers.shift.pressed	= true;
			if(e.altKey)	modifiers.alt.pressed =	true;
			if(e.metaKey)	modifiers.meta.pressed = true;

			for(var	i=0; k=keys[i],i<keys.length; i++) {
				//Modifiers
				if(k ==	'ctrl' || k	== 'control') {
					kp++;
					modifiers.ctrl.wanted =	true;

				} else if(k	== 'shift')	{
					kp++;
					modifiers.shift.wanted = true;

				} else if(k	== 'alt') {
					kp++;
					modifiers.alt.wanted = true;
				} else if(k	== 'meta') {
					kp++;
					modifiers.meta.wanted =	true;
				} else if(k.length > 1)	{ //If it is a special key
					if(special_keys[k] == code)	kp++;

				} else if(opt['keycode']) {
					if(opt['keycode'] == code) kp++;

				} else { //The special keys	did	not	match
					if(character ==	k) kp++;
					else {
						if(shift_nums[character] &&	e.shiftKey)	{ //Stupid Shift key bug created by	using lowercase
							character =	shift_nums[character];
							if(character ==	k) kp++;
						}
					}
				}
			}

			if(kp == keys.length &&
						modifiers.ctrl.pressed == modifiers.ctrl.wanted	&&
						modifiers.shift.pressed	== modifiers.shift.wanted &&
						modifiers.alt.pressed == modifiers.alt.wanted &&
						modifiers.meta.pressed == modifiers.meta.wanted) {
				callback(e);

				if(!opt['propagate']) {	//Stop the event
					//e.cancelBubble is	supported by IE	- this will	kill the bubbling process.
					e.cancelBubble = true;
					e.returnValue =	false;

					//e.stopPropagation	works in Firefox.
					if (e.stopPropagation) {
						e.stopPropagation();
						e.preventDefault();
					}
					return false;
				}
			}
		}
		this.all_shortcuts[shortcut_combination] = {
			'callback':func,
			'target':ele,
			'event': opt['type']
		};
		//Attach the function with the event
		if(ele.addEventListener) ele.addEventListener(opt['type'], func, false);
		else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func);
		else ele['on'+opt['type']] = func;
	},

	//Remove the shortcut -	just specify the shortcut and I	will remove	the	binding
	'remove':function(shortcut_combination)	{
		shortcut_combination = shortcut_combination.toLowerCase();
		var	binding	= this.all_shortcuts[shortcut_combination];
		delete(this.all_shortcuts[shortcut_combination])
		if(!binding) return;
		var	type = binding['event'];
		var	ele	= binding['target'];
		var	callback = binding['callback'];

		if(ele.detachEvent)	ele.detachEvent('on'+type, callback);
		else if(ele.removeEventListener) ele.removeEventListener(type, callback, false);
		else ele['on'+type]	= false;
	}
}

validationUtil.prototype = {
	// 생성자 Function
	initialize : function()
	{
	},
	onLoad : function(oForm) {
		var	elementArray = Form.getElements(oForm);
		var	radioMap = new JMap();

		for	(var i = 0 ; i < elementArray.length ; i++)
		{
       		if (elementArray[i].hasClassName("required") && elementArray[i].up() != null && elementArray[i].up().previous() != null) {
       			var element = elementArray[i].up().previous();
       			if (element != null && element.tagName == "TH" && (element.down('font', 0) == undefined || element.down('font', 0).innerHTML != "* ") && element.down('span', 0) == undefined) {
       				element.innerHTML = "<font color='#FF6600'>* </font>" + element.innerHTML;
       			}
        	}
			
			if(	elementArray[i].type ==	"radio") {
				if(	elementArray[i].getValue() != null)
					radioMap.put( elementArray[i].name,	null);
				else if( !radioMap.containsKey(	elementArray[i].name))
					radioMap.put( elementArray[i].name,	elementArray[i]);
			}

			if (elementArray[i].getAttribute('validType') != null) {
				var	type = elementArray[i].getAttribute('validType').split(":");
				switch (type[0]) {
					case "email" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'blur',
							function(event){
								(Event.element(event).value.isEmail() == false)	? Event.element(event).focus():	"";
							}, false);
						break;
					case "number" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown', function(event){
							var	type2 =	Event.element(event).getAttribute('validType').split(":");
							Event.element(event).value.chkNumber(type2[1], event);
						}, false);
						Event.observe(elementArray[i], 'keyup',	function(event){
							var	type2 =	Event.element(event).getAttribute('validType').split(":");
							temp = Event.element(event).value.chkLengthNum(type2[1], event);
							if(temp	!= '' && temp != null) Event.element(event).value =	temp;
						}, false);
						Event.observe(elementArray[i], 'blur', function(event){
							Event.element(event).value = Event.element(event).value.valNumber(event);
						}, false);
						break;
					case "mnumber" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
						}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeMinusSpecialChar();
							}, false);
						break;
					case "cnumber" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyCommaMaxNumber(event);
						}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeMinusSpecialChar();
							}, false);
						break;
					case "numberEng" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.isNumEng();
							}, false);
						break;
					case "money" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						elementArray[i].value = elementArray[i].value.money();
						Event.observe(elementArray[i], 'keydown',
							function(event){
									Event.element(event).value.onlyNumber(event);
							}, false);
						Event.observe(elementArray[i], 'blur',
							function(event){
								Event.element(event).value = Event.element(event).value.money();
							}, false);
						Event.observe(elementArray[i], 'focus',
							function(event){
								Event.element(event).value = Event.element(event).value.replace(/,/g, '');
								Event.element(event).select();
							}, false);
						break;
					case "ssn1"	:
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "ssn2"	:
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "foreign1"	:
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "foreign2"	:
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "Mobile1" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "Mobile2" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "Phone1" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "Phone2" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "id" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.isUserid();
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "passwd" :
						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.isNumEng();
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "Date"	:
						var	agent =	navigator.userAgent.toLowerCase();
						var	idx	= agent.indexOf('msie');
						var	maxLength =	elementArray[i].getAttribute("maxLength");
						if (idx	== -1) elementArray[i].setAttribute("maxLength", "10");

						Element.setStyle(elementArray[i], {"ime-mode":"disabled"});
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
								if (idx	== -1) {
									Event.element(event).value.isMaxLength3(maxLength, event);
								}
							}, false);
						Event.observe(elementArray[i], 'focus',
							function(event){
								Event.element(event).value = Event.element(event).value.replace(/-/g, '').replace(/:/g,	'').replace(/ /g, '');
								Event.element(event).select();
							}, false);
						Event.observe(elementArray[i], 'blur',
							function(event){
								Event.element(event).value = Event.element(event).value.date( Event.element(event).getAttribute("maxLength"));
							}, false);
						Event.observe(elementArray[i], 'keyup',
							function(event){
								Event.element(event).value = Event.element(event).value.escapeSpecialChar();
							}, false);
						break;
					case "maxLength" :
//						Event.observe(elementArray[i], 'keydown',
						Event.observe($(elementArray[i].name), 'keyup',
							function(event){
//								var	temp = Event.element(event).value.isMaxLength(type[1]);
								var	type2 =	Event.element(event).getAttribute('validType').split(":");
//								var	temp = Event.element(event).value.isMaxLength(type2[1]);
								var	temp = Event.element(event).value.isMaxLength2(type2[1], event);
								if (temp !=	'' && temp != null){
//									alert(elementArray[i].getAttribute('alt') +	message.getMessageString('message_284'));
									alert(Event.element(event).getAttribute('title') + message.getMessageString('message_284'));
									Event.element(event).value = temp;
								}
							}, false);
						break;
					case "name"	:
						var	temp;
						Element.setStyle(elementArray[i], {"ime-mode":"auto"});
						Event.observe(elementArray[i], 'keyup',
							function(event){
								//Event.element(event).value.isKorEng();
								//alert("value=="+Event.element(event).value);
								if(!Event.element(event).value.isKorEng()){
									//alert("Event.element(event).value="+Event.element(event).value);
									Event.element(event).value=Event.element(event).value.substr(0,Event.element(event).value.length-1);
								}

							}, false);
					/*	Event.observe(elementArray[i], 'keyup',
							function(event){
								//Event.element(event).value.isKorEng();
								Event.element(event).value = Event.element(event).value.isKorEng();

							}, false);*/
						break;
				}
			}
		}

		var	inits =	radioMap.keys();
		for( i=0; i<inits.length; i++){
			init = radioMap.get( inits[i]);
			if ( init != null) {
				init.checked = true;
				init.defaultChecked	= true;
			}
		}
		this.makeHelp(oForm);
	},
	onSubmit : function(oForm) {
		var	elementArray = Form.getElements(oForm);
		for	(var i = 0 ; i < elementArray.length ; i++)
		{
			if (elementArray[i].hasClassName("required")) {
				var	ssn1;
				var	foreign1;
				switch (elementArray[i].getAttribute('validType')) {
					case "email" :
						if (elementArray[i].value.isEmail() == false) {
							alert(elementArray[i].title + message.getMessageString('message_283'));
							elementArray[i].focus();
							return false;
							break;
						}
					case "number" :
						break;
					case "mnumber" :
						if (elementArray[i].value.lastIndexOf("-") >= 1) {
							alert(message.getMessageString('message_360'));
							elementArray[i].focus();
							return false;
						}
						break;
					case "numberEng" :
						if (elementArray[i].value.onlyNumber(event)	== false) {
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							ssn1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						} else {
							ssn1 = elementArray[i].value;
							break;
						}
						break;
					case "money" :  
                        elementArray[i].value = elementArray[i].value.replace(/,/g, '');
						break;
					case "ssn1"	:
						if (elementArray[i].value.onlyNumber(event)	== false) {
//							alert(elementArray[i].alt +	message.getMessageString('message_283'));
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							ssn1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						} else {
							ssn1 = elementArray[i].value;
							break;
						}
					case "ssn2"	:
						if (elementArray[i].value.onlyNumber(event)	== false) {
//							alert(elementArray[i].alt +	message.getMessageString('message_283'));
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							ssn1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						}else if((ssn1 + elementArray[i].value).isJumin() == false){
//							alert(elementArray[i].alt +	message.getMessageString('message_283'));
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							ssn1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						} else {
							break;
						}
					case "foreign1"	:
						if (elementArray[i].value.onlyNumber(event)	== false) {
//							alert(elementArray[i].alt +	message.getMessageString('message_283'));
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							foreign1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						} else {
							foreign1 = elementArray[i].value;
							break;
						}
					case "foreign2"	:
						if (elementArray[i].value.onlyNumber(event)	== false) {
//							alert(elementArray[i].alt +	message.getMessageString('message_283'));
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							foreign1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						}else if((foreign1 + elementArray[i].value).isForeign()	== false){
//							alert(elementArray[i].alt +	message.getMessageString('message_283'));
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							foreign1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						} else {
							break;
						}
					case "Mobile1" :
						if (elementArray[i].value.onlyNumber(event)	== false) {
//							alert(elementArray[i].alt +	message.getMessageString('message_283'));
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							ssn1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						} else {
							break;
						}
					case "Mobile2" :
						if (elementArray[i].value.onlyNumber(event)	== false) {
//							alert(elementArray[i].alt +	message.getMessageString('message_283'));
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							ssn1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						} else {
							break;
						}
					case "Phone1" :
						if (elementArray[i].value.onlyNumber(event)	== false) {
//							alert(elementArray[i].alt +	message.getMessageString('message_283'));
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							ssn1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						} else {
							break;
						}
					case "Phone2" :
						if (elementArray[i].value.onlyNumber(event)	== false) {
//							alert(elementArray[i].alt +	message.getMessageString('message_283'));
							alert(elementArray[i].title	+ message.getMessageString('message_283'));
							ssn1 = elementArray[i].value;
							elementArray[i].focus();
							return false;
						} else {
							break;
						}
					case "id" :
						break;
					case "passwd" :
						break;
					case "Date"	:
//						if (elementArray[i].getAttribute('value').isDate() == false) {
						if (elementArray[i].value.isDate() == false) {
//							alert(elementArray[i].getAttribute('alt') +	message.getMessageString('message_283'));
							alert(elementArray[i].getAttribute('title')	+ message.getMessageString('message_283'));
							elementArray[i].focus();
							return false;
						}
						if (elementArray[i].getAttribute('targetDate') != null && elementArray[i].getAttribute('targetDate') !=	"")	{
							var	targets	= elementArray[i].getAttribute('targetDate').split("&");
							for	(var j = 0 ; j < targets.length	; j++) {
								var	target = targets[j].split(":");
								if (target[0] == null || target[0] == "")
									return false;
								if ($(target[0]) ==	'[object]'){
									target[0] =	$F(target[0])
								}
								if (!elementArray[i].value.dateValidation(target[0], target[1],	target[0].getAttribute('title'), elementArray[i].getAttribute('title'))) {									elementArray[i].focus();
									return false;
								}
							}
						}
						break;
					}

					if(	elementArray[i].value.checkNull()) {
						alert(elementArray[i].getAttribute('title')	+ message.getMessageString('message_282'));
						if(elementArray[i].disabled==false){//폼 태그의 속성이 disabled인 경우 focus처리를 위해
							elementArray[i].focus();
						}else{
							elementArray[i].disabled=false;
							elementArray[i].focus();
							elementArray[i].disabled=true;
						}
						return false;
					}
			}
			else
			{
				switch (elementArray[i].getAttribute('validType')) {
					case "money" : 
                        elementArray[i].value = elementArray[i].value.replace(/,/g, '');
						break;				
				}
			}
		}
		return true;
	},
	makeHelp : function(oForm) {
		if ($('help') != undefined && oForm.getAttribute("required") != undefined) {
	        var elementArray = Form.getElements(oForm);
	        var html = '';
	        var requiredCount = 0;
	        var helpMap = new JMap();
	        
	        for (var i = 0 ; i < elementArray.length ; i++) {
		        if (elementArray[i].hasClassName("required") && !helpMap.containsKey(elementArray[i].id)) {
	        		helpMap.put( elementArray[i].id, elementArray[i].id);
	        		
		        	var title = elementArray[i].getAttribute("title");
	        		if (requiredCount > 0)
	        			html += "<br>";
	        		html += "* <font color='blue'><strong>'" + title + "'</strong></font> 은(는) <font color='red'>필수 입력항목</font> 입니다. ";	
	        		
	        		if (elementArray[i].getAttribute('validType') != null) {
	        			var validType = elementArray[i].getAttribute('validType').split(":");
		        		switch (validType[0]) {
		        			case "number" : html += "(숫자만 허용)";
		        						    break;
		        			case "money" : html += "(숫자만 허용)";
		        						    break;
		        			case "Date" : html += "(숫자만 허용)";
		        						    break;
		        			case "maxLength" :  var temp = elementArray[i].getAttribute('validType').split(":");
		        								html += "(최대 허용문자 : " +  temp[1] + " byte) ";
		        								break;
		        		}
	        		}
	        		 
	        		requiredCount++;
		        }
	        }
	        html += "</font>";
	        Element.update($('help'), html);
        }
	},
	date : function(element) {
		var	str	= "20070102";
		alert(str.isDate("YYYY-DD-MM"));
	},
	doValidCheck : function(oForm) {
		var	elementArray = Form.getElements(oForm);
		for	(var i = 0 ; i < elementArray.length ; i++)
		{
			if (elementArray[i].hasClassName("required")) {
//			if (elementArray[i].getAttribute('required') !=null) {
				var	ssn1;
				var	foreign1;
				switch (elementArray[i].getAttribute('validType')) {
					case "email" :
//						(Event.element(event).value.isEmail() == false)	? alert(Event.element(event).alt + message.getMessageString('message_283')): "";
						(Event.element(event).value.isEmail() == false)	? alert(Event.element(event).title + message.getMessageString('message_283')): "";
//						elementArray[i].focus();
						return Event.element(event).id;
						break;
					case "number" :
						break;
					case "mnumber" :
						break;
					case "numberEng" :
						break;
					case "money" :
						break;
					case "ssn1"	:
//						(Event.element(event).value.onlyNumber(event) == false)	? alert(Event.element(event).alt + message.getMessageString('message_283')): "";
						(Event.element(event).value.onlyNumber(event) == false)	? alert(Event.element(event).title + message.getMessageString('message_283')): "";
						ssn1 = Event.element(event).value;
//						elementArray[i].focus();
						return Event.element(event).id;
						break;
					case "ssn2"	:
//						(Event.element(event).value.onlyNumber(event) == false)	? alert(Event.element(event).alt + message.getMessageString('message_283')): "";
						(Event.element(event).value.onlyNumber(event) == false)	? alert(Event.element(event).title + message.getMessageString('message_283')): "";
//						((ssn1 + Event.element(event).value).isJumin() == false) ? alert(Event.element(event).alt +	message.getMessageString('message_283')): "";
						((ssn1 + Event.element(event).value).isJumin() == false) ? alert(Event.element(event).title	+ message.getMessageString('message_283')):	"";
//						elementArray[i].focus();
						return Event.element(event).id;
						break;
					case "foreign1"	:
//						(Event.element(event).value.onlyNumber(event) == false)	? alert(Event.element(event).alt + message.getMessageString('message_283')): "";
						(Event.element(event).value.onlyNumber(event) == false)	? alert(Event.element(event).title + message.getMessageString('message_283')): "";
//						elementArray[i].focus();
						foreign1 = Event.element(event).value;
						return Event.element(event).id;
						break;
					case "foreign2"	:
//						(Event.element(event).value.onlyNumber(event) == false)	? alert(Event.element(event).alt + message.getMessageString('message_283')): "";
//						((ssn1 + Event.element(event).value).isForeign() ==	false) ? alert(Event.element(event).alt	+ message.getMessageString('message_283')):	"";
						(Event.element(event).value.onlyNumber(event) == false)	? alert(Event.element(event).title + message.getMessageString('message_283')): "";
						((ssn1 + Event.element(event).value).isForeign() ==	false) ? alert(Event.element(event).title +	message.getMessageString('message_283')): "";
//						elementArray[i].focus();
						return Event.element(event).id;
						break;
					case "Mobile1" :
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						break;
					case "Mobile2" :
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						break;
					case "Phone1" :
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						break;
					case "Phone2" :
						Event.observe(elementArray[i], 'keydown',
							function(event){
								Event.element(event).value.onlyNumber(event);
							}, false);
						break;
					case "id" :
						break;
					case "passwd" :
						break;
					case "Date"	:
//						if (elementArray[i].getAttribute('value').isDate() == false) {
						if (elementArray[i].value.isDate() == false) {
							alert(elementArray[i].getAttribute('title')	+ message.getMessageString('message_283'));
//							alert(elementArray[i].getAttribute('alt') +	message.getMessageString('message_283'));
//							elementArray[i].focus();
							return elementArray[i].id;
						}
						if (elementArray[i].getAttribute('targetDate') != null && elementArray[i].getAttribute('targetDate') !=	"")	{
							var	targets	= elementArray[i].getAttribute('targetDate').split("&");
							for	(var j = 0 ; j < targets.length	; j++) {
								var	target = targets[j].split(":");
								if (target[0] == null || target[0] == "")
									return false;
								if ($(target[0]) ==	'[object]'){
									target[0] =	$F(target[0])
								}
//								if (!elementArray[i].value.dateValidation(target[0], target[1],	target[2], elementArray[i].getAttribute('alt'))) {
								if (!elementArray[i].value.dateValidation(target[0], target[1],	target[2], elementArray[i].getAttribute('title'))) {
//									elementArray[i].focus();
									return elementArray[i].id;
								}
							}
						}
						break;
					}
					if(	elementArray[i].value.checkNull()) {
//						alert(elementArray[i].getAttribute('alt') +	message.getMessageString('message_282'));
						alert(elementArray[i].getAttribute('title')	+ message.getMessageString('message_282'));
//						elementArray[i].focus();
						return elementArray[i].id;
					}
			}
		}
		return "";
	}
}
envUtil.prototype =	{
	// 생성자 Function
	initialize : function()
	{
	},
	isIE : function()
	{
		return (navigator.appName.charAt(0)	== 'M')	? true : false;
	}
}
dwrInvokeUtil.prototype	= {
	// 생성자 Function
	initialize : function()	{
	},
	invokeMap :	function( formData,	options, syncFlag) {
		var	_result;
		if (!syncFlag)
			DWREngine.setAsync(false);

		var	beanId;
		var	method;

		if(	options){
			if(	options.beanId){
				beanId = options.beanId;
			}
			if(	options.method){
				method = options.method;
			}
		}
	  
		if(	formData.length	== undefined)
		{
			baseDWR.handleMap( formData, beanId, method, {
				callback : function(dataFromServer)	{
					_result	= dataFromServer;
				}, errorHandler	: function(errorMessage) {
					alert("Error Message : " + errorMessage	+ "\n 에러가 발생하였습니다.");
				}, exceptionHandler	: function(exceptionMessage) {
				//	alert("에러가 발생하였습니다.\n에러페이지화면으로 이동합니다." );
				//	document.location.href = errorPage;
				}, timeout:3000
			});
		}
		else {
			baseDWR.handleMapArray(	formData, beanId, method, {
				callback : function(dataFromServer)	{
					_result	= dataFromServer;
				}, errorHandler	: function(errorMessage) {
					alert("Error Message : " + errorMessage	+ "\n 에러가 발생하였습니다.");
				}, exceptionHandler	: function(exceptionMessage) {
				//	document.location.href = errorPage;
				}, timeout:10000
			});
		}
		if (!syncFlag)
			DWREngine.setAsync(true);
		return _result;
	}
}

// 객체	생성
var	commUtil = new commonUtil();
var	validUtil =	new	validationUtil();
//var env =	new	envUtil();
var	dwrUtil	= new dwrInvokeUtil();

	/*--------------------------------------------------------------------------------*
	*  String prototype
	*--------------------------------------------------------------------------------*/
	 //-----------------------------------------------------------------------------
	 //	문자의 좌, 우 공백 제거
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.trim = function()	{
		 return	this.replace(/^\s*|\s*$/g, "");
	 }
	 //-----------------------------------------------------------------------------
	 //	문자의 좌 공백 제거
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.ltrim	= function() {
		 return	this.replace(/\^s*/, "");
	 }
	 //-----------------------------------------------------------------------------
	 //	문자의 우 공백 제거
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.rtrim	= function() {
		 return	this.replace(/\s*$/, "");
	 }
	 //-----------------------------------------------------------------------------
	 //	문자열의 byte 길이 반환
	 //	@return	: int
	 //-----------------------------------------------------------------------------
	 String.prototype.rByte	= function() {
		 var cnt = 0;
		 for (var i	= 0; i < this.length; i++) {
			 if	(this.charCodeAt(i)	> 127)
				 cnt +=	2;
			 else
				 cnt++;
		 }
		 return	cnt;
	 }
	 //-----------------------------------------------------------------------------
	 //	문자열의 최대 길이만 입력
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isMaxLength =	function() {
		if (event.keyCode == 8 || event.keyCode	== 46 || (event.keyCode	>= 37 && event.keyCode <= 40)) {
			return;
		}
		var	cnt	= 0;
		var	hanCount = 0;
		var	max	= arguments[0];
		var	temp ="";
		for	(var i = 0;	i <	this.length; i++) {
			 if	(this.charCodeAt(i)	> 127) {
				 cnt +=	2;
				 hanCount++;
//				 if	(cnt >=	max) {
				 if	(cnt > max)	{
					if ((cnt - hanCount	- 1) % 2 ==	0)
					{
						temp = this.substring(0, cnt - hanCount	- 1);
//						temp = this.substring(0, cnt - hanCount	- 2);
					}
					else
					{
//						temp = this.substring(0, cnt - hanCount);
						temp = this.substring(0, cnt - hanCount	- 1);
					}
					return temp;
				 }
				 else {

				 }
			 }
			 else {
				 cnt++;
//				 if	(cnt >=	max) {
				 if	(cnt > max)	{
					temp = this.substring(0, cnt - hanCount	- 1);
					return temp;
				 }
				 else {
				 }
			 }
		}
	 }

     //DB의 한글 글자당 바이트수가 3바이트인 경우(예:UTF-8)
	 String.prototype.isMaxLength2 = function(max, event) {
		if (event.keyCode == 8 || event.keyCode	== 46 || (event.keyCode	>= 37 && event.keyCode <= 40)) {
			return;
		}
		var	cnt	= 0;
		var	hanCount = 0;
		var	temp ="";
		for	(var i = 0;	i <	this.length; i++) {
			if (this.charCodeAt(i) > 127) {
				cnt	+= 3;
				hanCount++;
			} else {
				cnt++;
			}
			if (cnt	> max) {
				temp = this.substring(0, cnt - (hanCount*2)	- 1);
				return temp;
			}
		}
	}

	 String.prototype.isMaxLength3 = function(maxLength, event)	{//탭키	제외 시킴
		if (maxLength == null || maxLength == "")
			maxLength =	8;
		else
			maxLength =	parseInt(maxLength);

		if ( this.length < maxLength) {
			return true;
		} else {
			if ( event.keyCode == 9	|| event.keyCode ==	8 || event.keyCode == 16 ||	(event.keyCode >= 35 &&	event.keyCode <= 46)) {
				return true;
			} else {
//				if (Event.element(event).select()) {
//					return true;
//				} else {
					event.preventDefault();
//				}
//			event.returnValue =	false;
			}
		}
	 }
	 //-----------------------------------------------------------------------------
	 //	정수형으로 변환
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.rInt = function()	{
		 if(!isNaN(this)) {
			 return	parseInt(this);
		 }
		 else {
			 return	null;
		 }
	 }
	 //-----------------------------------------------------------------------------
     // 숫자만 가져 오기
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.num =	function() {
		 return	(this.trim().replace(/[^0-9]/g,	""));
	 }
	 //-----------------------------------------------------------------------------
	 //	숫자에 3자리마다 , 를 찍어서 반환
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.money	= function() {
		 var num = this.trim();
		 while((/(-?[0-9]+)([0-9]{3})/).test(num)) {
			 num = num.replace((/(-?[0-9]+)([0-9]{3})/), "$1,$2");
		 }
		 return	num;
	 }
	 //-----------------------------------------------------------------------------
     // 숫자의 자리수(cnt)에 맞도록 반환
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.digits = function(cnt) {
		 var digit = "";
		 if	(this.length < cnt)	{
			 for(var i = 0;	i <	cnt	- this.length; i++)	{
				 digit += "0";
			 }
		 }
		 return	digit +	this;
	 }
	 //-----------------------------------------------------------------------------
     // " -> &#34; ' -> &#39;로 바꾸어서 반환
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.quota	= function() {
		 return	this.replace(/"/g, "&#34;").replace(/'/g, "&#39;");
	 }
	 //-----------------------------------------------------------------------------
	 //	파일 확장자만 가져오기
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.ext =	function() {
		 return	(this.indexOf(".") < 0)	? "" : this.substring(this.lastIndexOf(".")	+ 1, this.length);
	 }
	 //-----------------------------------------------------------------------------
     // URL에서 파라메터 제거한 순수한 url 얻기
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.uri =	function() {
		 var arr = this.split("?");
		 arr = arr[0].split("#");
		 return	arr[0];
	 }

	/*---------------------------------------------------------------------------------*
	*  각종	체크 함수들	*---------------------------------------------------------------------------------*/
	 //-----------------------------------------------------------------------------
     // 정규식에 쓰이는 특수문자를 찾아서 이스케이프 한다.
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.meta = function()	{
		 var str = this;
		 var result	= ""
		 for(var i = 0;	i <	str.length;	i++) {
			 if((/([$()*+-.[]?\^{}|]{1})/).test(str.charAt(i)))	{
				 result	+= str.charAt(i).replace((/([$()*+-.[]?\^{}|]{1})/), "\$1");
			 }
			 else {
				 result	+= str.charAt(i);
			 }
		 }
		 return	result;
	 }
	 //-----------------------------------------------------------------------------
     // 정규식에 쓰이는 특수문자를 찾아서 이스케이프 한다.
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.escapeSpecialChar	= function() {
		 var str = this;
		 var result	= ""
		 for(var i = 0;	i <	str.length;	i++) {
			 if((/[^a-zA-Z0-9?]/).test(str.charAt(i))) {
				if (str.charAt(i) == ".") {
					result += str.charAt(i);
				}
			 }
			 else {
				 result	+= str.charAt(i);
			 }
		 }
		return result;
	 }
	 //-----------------------------------------------------------------------------
     // 정규식에 쓰이는 특수문자를 찾아서 이스케이프 한다. ('-' 포함)
	 //	@return	: String
	 //-----------------------------------------------------------------------------
	 String.prototype.escapeMinusSpecialChar = function() {
		 var str = this;
		 var result	= ""
		 for(var i = 0;	i <	str.length;	i++) {
			 if(i==0){
				if((/[^a-zA-Z0-9-?]/).test(str.charAt(i))) {
					if (str.charAt(i) == ".") {
						result += str.charAt(i);
					}
				}
				else {
				 result	+= str.charAt(i);
				}
			 }else{
				if((/[^a-zA-Z0-9?]/).test(str.charAt(i))) {
					if (str.charAt(i) == ".") {
						result += str.charAt(i);
					}
				}
				else {
					result += str.charAt(i);
				}
			 }
		 }
		return result;
	 }

	 //-----------------------------------------------------------------------------
	 //	최소 최대 길이인지 검증
	 //	str.isLength(min [,max])
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isLength = function()	{
		 var min = arguments[0];
		 var max = arguments[1]	? arguments[1] : null;
		 var success = true;
		 if(this.length	< min) {
			 success = false;
		 }
		 if(max	&& this.length > max) {
			 success = false;
		 }
		 return	success;
	 }
	 //-----------------------------------------------------------------------------
	 //	최소 최대 바이트인지 검증
	 //	str.isByteLength(min [,max])
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isByteLength = function()	{
		 var min = arguments[0];
		 var max = arguments[1]	? arguments[1] : null;
		 var success = true;
		 if(this.rByte() < min)	{
			 success = false;
		 }
		 if(max	&& this.rByte()	> max) {
			 success = false;
		 }
		 return	success;
	 }
	 //-----------------------------------------------------------------------------
	 //	공백이나 널인지	확인
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isBlank =	function() {
		 var str = this.trim();
		 for(var i = 0;	i <	str.length;	i++) {
			 if	((str.charAt(i)	!= "t")	&& (str.charAt(i) != "n") && (str.charAt(i)!="r")) {
				 return	false;
			 }
		 }
		 return	true;
	 }
	 //-----------------------------------------------------------------------------
	 //	널인지 확인
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isNull = function() {
		 for(var i = 0;	i <	this.length; i++) {
			 if	((this.charAt(i) !=	"t") &&	(this.charAt(i)	!= "n")	&& (this.charAt(i)!="r")) {
				 return	false;
			 }
		 }
		 return	true;
	 }
	 //-----------------------------------------------------------------------------
	 //	널인지 체크
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.checkNull	= function() {
		 var str = this.replace(/ /g, '');
		 if	(str.length	> 0)
			return false;
		 else
			return true;
	 }
	 //-----------------------------------------------------------------------------
	 //	숫자로 구성되어	있는지 학인
	 //	arguments[0] : 허용할 문자셋
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isNum	= function() {
		 return	(/^[0-9]+$/).test(this)	? true : false;
	 }

	 //-----------------------------------------------------------------------------
	 //	영어만 허용	- arguments[0] : 추가 허용할 문자들
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isEng	= function() {
		 return	(/^[a-zA-Z]+$/).test(this) ? true :	false;
	 }

	 //-----------------------------------------------------------------------------
     // 한글과 영문만 허용 - arguments[0] : 추가 허용할 문자들
	 //	@return	: boolean
	 //-------------------------------------------------------------------
	 String.prototype.isKorEng = function()	{
	  var sBit = '';

	  for(i=0;i<this.length;i++)
	  {
		  sBit = this.charAt(i);

		  if(!this.isEng() &&  escape( sBit	).length <=	4  )
		  {

		   return false;
		  }
	  }
		return true;
	}

	 //-----------------------------------------------------------------------------
     // 숫자와 영어만 허용 - arguments[0] : 추가 허용할 문자들
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isEngNum = function()	{
		 return	(/^[0-9a-zA-Z]+$/).test(this) ?	true : false;
	 }
	 //-----------------------------------------------------------------------------
     // 숫자와 영어만 허용 - arguments[0] : 추가 허용할 문자들
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isNumEng = function()	{
		 return	this.isEngNum(arguments[0]);
	 }
	 //-----------------------------------------------------------------------------
	 //	아이디 체크	영어와 숫자만 체크 첫글자는	영어로 시작	- arguments[0] : 추가 허용할 문자들
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isUserid = function()	{
		 if	((event.keyCode	>= 37 && event.keyCode <= 40) || (event.keyCode	>= 48 && event.keyCode <= 90)
				|| (event.keyCode >= 96	&& event.keyCode <=	105) ||	event.keyCode == 13	|| event.keyCode ==	46
				|| event.keyCode ==	8 || event.keyCode == 9	|| event.keyCode >=	25 && event.keyCode	<= 28) {
			return true;
		 } else	{
			event.returnValue =	false;
		 }
	 }
	 //-----------------------------------------------------------------------------
	 //	주민번호 체크 -	arguments[0] : 주민번호	구분자
	 //	XXXXXX-XXXXXXX
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isJumin =	function() {
		 var arg = arguments[0]	? arguments[0] : "";
		 var jumin = eval("this.match(/[0-9]{2}[01]{1}[0-9]{1}[0123]{1}[0-9]{1}" + arg + "[1234]{1}[0-9]{6}$/)");
		 if(jumin == null) {
			 return	false;
		 }
		 else {
			 jumin = jumin.toString().num().toString();
		 }
		 //	생년월일 체크
		 var birthYY = (parseInt(jumin.charAt(6)) == (1	||2)) ?	"19" : "20";
		 birthYY +=	jumin.substr(0,	2);
		 var birthMM = jumin.substr(2, 2) -	1;
		 var birthDD = jumin.substr(4, 2);
		 var birthDay =	new	Date(birthYY, birthMM, birthDD);
		 if(birthDay.getYear() % 100 !=	jumin.substr(0,2) || birthDay.getMonth() !=	birthMM	|| birthDay.getDate() != birthDD) {
			 return	false;
		 }
		 var sum = 0;
		 var num = [2, 3, 4, 5,	6, 7, 8, 9,	2, 3, 4, 5]
		 var last =	parseInt(jumin.charAt(12));
		 for(var i = 0;	i <	12;	i++) {
			 sum +=	parseInt(jumin.charAt(i)) *	num[i];
		 }
		 return	((11 - sum % 11) % 10 == last) ? true :	false;
	 }
	 //-----------------------------------------------------------------------------
	 //	외국인 등록번호	체크 - arguments[0]	: 등록번호 구분자
	 //	XXXXXX-XXXXXXX
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isForeign	= function() {
		 var arg = arguments[0]	? arguments[0] : "";
		 var jumin = eval("this.match(/[0-9]{2}[01]{1}[0-9]{1}[0123]{1}[0-9]{1}" + arg + "[5678]{1}[0-9]{1}[02468]{1}[0-9]{2}[6789]{1}[0-9]{1}$/)");
		 if(jumin == null) {
			 return	false;
		 }
		 else {
			 jumin = jumin.toString().num().toString();
		 }
		 //	생년월일 체크
		 var birthYY = (parseInt(jumin.charAt(6)) == (5	|| 6)) ? "19" :	"20";
		 birthYY +=	jumin.substr(0,	2);
		 var birthMM = jumin.substr(2, 2) -	1;
		 var birthDD = jumin.substr(4, 2);
		 var birthDay =	new	Date(birthYY, birthMM, birthDD);
		 if(birthDay.getYear() % 100 !=	jumin.substr(0,2) || birthDay.getMonth() !=	birthMM	|| birthDay.getDate() != birthDD) {
			 return	false;
		 }
		 if((parseInt(jumin.charAt(7)) * 10	+ parseInt(jumin.charAt(8))) % 2 !=	0) {
			 return	false;
		 }
		 var sum = 0;
		 var num = [2, 3, 4, 5,	6, 7, 8, 9,	2, 3, 4, 5]
		 var last =	parseInt(jumin.charAt(12));
		 for(var i = 0;	i <	12;	i++) {
			 sum +=	parseInt(jumin.charAt(i)) *	anum[i];
		 }
		 return	(((11 -	sum	% 11) %	10)	+ 2	== last) ? true	: false;
	 }
	 //-----------------------------------------------------------------------------
	 //	사업자번호 체크	- arguments[0] : 등록번호 구분자
	 //	XX-XXX-XXXXX
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isBiznum = function()	{
		 var arg = arguments[0]	? arguments[0] : "";
		 var biznum	= eval("this.match(/[0-9]{3}" +	arg	+ "[0-9]{2}" + arg + "[0-9]{5}$/)");
		 if(biznum == null)	{
			 return	false;
		 }
		 else {
			 biznum	= biznum.toString().num().toString();
		 }
		 var sum = parseInt(biznum.charAt(0));
		 var num = [0, 3, 7, 1,	3, 7, 1, 3];
		 for(var i = 1;	i <	8; i++)	sum	+= (parseInt(biznum.charAt(i)) * num[i]) % 10;
		 sum +=	Math.floor(parseInt(parseInt(biznum.charAt(8)))	* 5	/ 10);
		 sum +=	(parseInt(biznum.charAt(8))	* 5) % 10 +	parseInt(biznum.charAt(9));
		 return	(sum % 10 == 0)	? true : false;
	 }
	 //-----------------------------------------------------------------------------
	 //	법인 등록번호 체크 - arguments[0] :	등록번호 구분자
	 //	XXXXXX-XXXXXXX
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isCorpnum	= function() {
		 var arg = arguments[0]	? arguments[0] : "";
		 var corpnum = eval("this.match(/[0-9]{6}" + arg + "[0-9]{7}$/)");
		 if(corpnum	== null) {
			 return	false;
		 }
		 else {
			 corpnum = corpnum.toString().num().toString();
		 }
		 var sum = 0;
		 var num = [1, 2, 1, 2,	1, 2, 1, 2,	1, 2, 1, 2]
		 var last =	parseInt(corpnum.charAt(12));
		 for(var i = 0;	i <	12;	i++) {
			 sum +=	parseInt(corpnum.charAt(i))	* num[i];
		 }
		 return	((10 - sum % 10) % 10 == last) ? true :	false;
	 }
	 //-----------------------------------------------------------------------------
	 //	이메일의 유효성을 체크
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isEmail =	function() {
		 return	(/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i).test(this.trim());
	 }
	 //-----------------------------------------------------------------------------
	 //	전화번호 체크 -	arguments[0] : 전화번호	구분자
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isPhone =	function() {
		 var arg = arguments[0]	? arguments[0] : "";
		 return	eval("(/(02|0[3-9]{1}[0-9]{1})"	+ arg +	"[1-9]{1}[0-9]{2,3}" + arg + "[0-9]{4}$/).test(this)");
	 }
	 //-----------------------------------------------------------------------------
     // 핸드폰번호 체크 - arguments[0] : 핸드폰 구분자
	 //	@return	: boolean
	 //-----------------------------------------------------------------------------
	 String.prototype.isMobile = function()	{
		 var arg = arguments[0]	? arguments[0] : "";
		 return	eval("(/01[016789]"	+ arg +	"[1-9]{1}[0-9]{2,3}" + arg + "[0-9]{4}$/).test(this)");
	 }
	 //-----------------------------------------------------------------------------
	 // 숫자 체크 - type : 숫자 타입 ([-]최대길이, 소수점 자리수) - type이 없을 경우 정수만 허용(자리수도 체크안함)
	 // type 예 : [-][5][,2]
	 // @ return
	 //-----------------------------------------------------------------------------
	 String.prototype.chkNumber = function(type, event){
	     var max = 0;                                   //숫자 최대 길이
	     var pIndex = 0;                                //유효 소수점 자리수
	     var chkMinus = false;                          //마이너스 체크
	     var fieldValue = this.replace(/-/g, '');       //필드의 값
	     var minusIndex = this.indexOf('-');            //필드 값의 마이너스 자리수
	     var pointIndex = fieldValue.indexOf('.');      //필드 값의 소수점 자리수
	     
	     //type에서 마이너스, 최대길이, 유효 소수점 자리수를 셋팅한다.
	     //type : [-][5][,2]
	     if(type != null && type != 'undefined' && type != '') {
	         temp = getOnlyString(type).split(",");
	         if( temp[0].indexOf('-') == 0 ) {
	           chkMinus = true;                         //마이너스 체크 셋팅
	           temp[0] = temp[0].substr(1,temp[0].length-1);
	         }
	         if(temp[0].isNum()) max = temp[0];         //최대길이 셋팅
	         //if(!temp[1].isBlank()) pIndex = temp[1];   //유효 소수점 자리수 셋팅
	     }
	    
	     //alert('value : '+ this + '\nvalue.num().length : '+ fieldValue.num().length+ '\npointIndex : '+ pointIndex);
	     //keyCode : 9 = TAB , 8 = backspace , 16 = shift , 46 = DEL , 190(or110) = . , 109(or189)= - 
	     if( event.keyCode == 190 || event.keyCode == 110 || (event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105) ){
	         if(event.keyCode == 190 || event.keyCode == 110) {  
	             if(pIndex <= 0) {
	                 event.preventDefault();
	             }else {
	                 if(pointIndex >= 0 || fieldValue.num().length > max - pIndex || (minusIndex == 0 && fieldValue.num().length == 0 ) ) {
	                     event.preventDefault();
	                 }
	             }
	         } else {
	             if(max > 0){
		             if(pointIndex < 0) {
		                 if(fieldValue.num().length >= max - pIndex) event.preventDefault();
		             } else{
		                 if( fieldValue.num().length - pointIndex >= pIndex ) event.preventDefault();
		             }
	             }
	         }
	     } else if(event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 46 || (event.keyCode >= 35 && event.keyCode <= 40)){
	         //벡스페이스, 탭, DEL, 방향키는 정상 작동
	     } else if(event.keyCode == 109 || event.keyCode ==189){
	         if(!chkMinus || minusIndex >= 0 || fieldValue.length > 0 ) event.preventDefault();
	     } else {
	         event.preventDefault();
	     }
	 }
	 //-----------------------------------------------------------------------------
	 //	숫자 체크 -	valType:number 일 경우 blur	이벤트 발생	시 첫째자리의 0과 소수점 처리
	 //	@ return number
	 //-----------------------------------------------------------------------------
	 String.prototype.valNumber	= function(event) {
		 var minusIndex	= this.indexOf('-');
		 var chkMinus =	minusIndex == 0	? true : false;

		 var num = this.replace(/-/g, '');		   // num :	'-'를 뺀 숫자
		 var zeroIndex = num.indexOf('0');
		 var pointIndex	= num.indexOf('.');

		 if(num	== '.' || num == '') return	'';		// '.' or '-' 일 경우 clear

		 if(pointIndex == 0) {						// .0 ==> 0.0
			 num = '0' + num;
		 }
		 if(num.num().length - pointIndex == 0)	{	// 0. ==> 0.0
			 num = num + '0';
		 }

		 while(true){								// 09 ==> 9	: 첫번째 0 삭제
			 if( (num.length ==	1 &&num	== 0) || zeroIndex != 0	|| (zeroIndex == 0 && pointIndex ==	1) ) break;// '0.1'에서	0은	유지
			 num = num.substr(1, num.length-1);
			 pointIndex	= num.indexOf('.');
			 zeroIndex = num.indexOf('0');
		 }
		 if(chkMinus &&	num	!= 0 ) num = '-' + num;	 //	'-'	다시 셋팅

		 return	num;
	 }
	 String.prototype.onlyNumber = function(event) {//탭키 제외	시킴
		if ( event.keyCode == 0 || event.keyCode == 9 || event.keyCode == 8 || event.keyCode == 16 || (event.keyCode >= 35 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105) || event.keyCode == 109 || event.keyCode == 189) { //??????? ???, -???(109,189)
			return true;
		} else {
			event.preventDefault();
//			event.returnValue =	false;
		}
	 }
	 String.prototype.isNumber = function(event) {
		if (!isNaN(Event.element(event).value))	{
			return true;
		} else {
			return false;
		}
	 }
	 String.prototype.isMNumber	= function(event) {//탭키 제외 시킴
		if ( event.keyCode == 0 || event.keyCode	== 9 ||	event.keyCode == 8 || event.keyCode	== 16 || (event.keyCode	>= 35 && event.keyCode <= 57) || (event.keyCode	>= 96 && event.keyCode <= 105))	{ //???????	???
				return true;
		} else {
			event.returnValue =	false;
		}
	 }
	 String.prototype.onlyCommaNumber =	function(event)	{
		if ( event.keyCode == 0 || event.keyCode == 190 || event.keyCode == 8	|| event.keyCode ==	16 || (event.keyCode >=	35 && event.keyCode	<= 57) || (event.keyCode >=	96 && event.keyCode	<= 105)) { //??????? ???
			if (this >=	100) {
				if (event.keyCode == 8 || event.keyCode	== 16 || event.keyCode == 37 ||	event.keyCode == 39	|| event.keyCode ==	46)
					return true;
				else
					event.returnValue =	false;
			}
		} else {
			event.returnValue =	false;
		}
	 }
	 
	 String.prototype.onlyCommaMaxNumber =	function(event)	{
		if ( event.keyCode == 0 || event.keyCode == 190 || event.keyCode == 8	|| event.keyCode ==	16 || (event.keyCode >=	35 && event.keyCode	<= 57) || (event.keyCode >=	96 && event.keyCode	<= 105)) { //??????? ???
			return true;
		} else {
			event.returnValue =	false;
		}
	 }
    //-----------------------------------------------------------------------------
    // 숫자 자리수 체크
    // type 예 : [-][5][,2]
    // @ return
    //-----------------------------------------------------------------------------
    String.prototype.chkLengthNum = function(type, event){
        var maxLeng = 0;
        var maxPleng = 0;
        var chkMinus = false;
        var chkPoint = false;
        
        var num = this.replace(/-/g, '');
        var minusIndex = this.indexOf('-');
        var pointIndex = num.indexOf('.');
        var posNumLeng = pointIndex >= 0 ? num.substr(0,pointIndex).length : num.length;
        var negNumLeng = pointIndex >= 0 ? num.substr(pointIndex+1, num.length).length : 0;

        
        //type에서 마이너스, 최대길이, 유효 소수점 자리수를 셋팅한다.
        //type : [-][5][,2]
        if(type != null && type != 'undefined' && type != '') {
            temp = getOnlyString(type).split(",");
            if( temp[0].indexOf('-') == 0 ) {
                chkMinus = true;                       //마이너스 체크 셋팅
                temp[0] = temp[0].replace(/-/g, '');
            }
            if(temp[0] != '' && temp[0] != null) maxLeng = temp[0];     //최대길이 셋팅
            if(temp[1] != '' && temp[1] != null){
                chkPoint = true;
                maxPleng = temp[1];                    //유효 소수점 자리수 셋팅
            }
        }
        
        var str = '';
        if(!event.shiftKey && (event.keyCode == 8 || event.keyCode == 46 || (event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105)) ){
	        if( maxLeng != 0 && posNumLeng > maxLeng){
	            str = pointIndex >= 0 ? num.substr(0, maxLeng) + '.' + num.substr(pointIndex+1, num.length) : num.substr(0, maxLeng);
		        if(minusIndex == 0) str = '-' + str;
	        }
	        if( maxPleng != 0 && negNumLeng > maxPleng){
	            str = num.substr(0, pointIndex) + '.' + num.substr(pointIndex+1, maxPleng);
	            if(minusIndex == 0) str = '-' + str;
	        }
        }else if(event.keyCode == 109 || event.keyCode == 189){
            if(this.indexOf('-') !=0) str = this.replace(/-/g, '');
        }else{
            str = '';
        }
        
        return str;
        
    }
	 String.prototype.onlyClear	= function() {
		if (event.keyCode == 8 || event.keyCode	== 46) {
			return '';
		} else {
			event.returnValue =	false;
		}
	 }
	 String.prototype.isDate = function() {
		var	arg	= arguments[0] ? arguments[0] :	"";
		var	sDate=this.replace(/-/g, '').replace(/:/g, '').replace(/ /g, '');

		if(	sDate.length ==	8 || sDate.length == 12) {
			if (sDate.length ==	8) {
				if(	!sDate.substr(0,4).isNum() || !sDate.substr(4,2).isNum() ||	!sDate.substr(6,2).isNum())	{
					return false;
				}
			} else {
			  if( !sDate.substr(0,4).isNum() ||	!sDate.substr(4,2).isNum() || !sDate.substr(6,2).isNum() ||	!sDate.substr(8,2).isNum() || !sDate.substr(10,2).isNum()) {
					return false;
				}
			}
		}
		else {
			return false;
		}

		var	aDaysInMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);

		iYear=eval(sDate.substr(0,4));
		iMonth=eval(sDate.substr(4,2));
		iDay=eval(sDate.substr(6,2));
		var	iDaysInMonth=(iMonth!=2)?aDaysInMonth[iMonth-1]:((iYear%4==0 &&	iYear%100!=0 ||	iYear %	400==0)?29:28);

		if(	(iDay!=null	&& iMonth!=null	&& iYear!=null	&& iMonth<13 &&	iMonth>0 &&	iDay>0 && iDay<=iDaysInMonth) == false )  {
			return false;
		}
		return true;
	 }
	 String.prototype.date = function()	{
		var	arg	= arguments[0] == 12 ? " 00:00"	: "";
		if(this.length <= 4) return	this;
		else if(this.length	<= 6) return this.substr(0,4) +	"-"	+ this.substr(4,2);
		else if(this.length	<= 8) {
			if(this.length == 8) {
				var	result = this.substr(0,4) +	"-"	+ this.substr(4,2) + "-" + this.substr(6, 2) + arg;
				return result;
			} else {
				return this.substr(0,4)	+ "-" +	this.substr(4,2) + "-" + this.substr(6,	2);
			}
		}
		else if(this.length	< 10) return this.substr(0,4) +	"-"	+ this.substr(4,2) + "-" + this.substr(6, 2) + " " + this.substr(8,	2);
		else if(this.length	== 10 )	return this.substr(0,4)+"" + this.substr(4,3)+"" + this.substr(7, 3) + arg;
		else if(this.length	<=12) return this.substr(0,4) +	"-"	+ this.substr(4,2) + "-" + this.substr(6, 2) + " " + this.substr(8,	2) + ":" + this.substr(10, 2);
	 }
	 //-----------------------------------------------------------------------------
	 //	날짜비교 체크 -	arguments[0] : 전화번호	구분자
			 //	@return	: int
	 //	0 :	error
	 //	1 :	높음
	 //	2 :	낮음
	 //	3 :	같음
	 //-----------------------------------------------------------------------------
	 String.prototype.dateValidation = function() {

		var	targetElementValue = arguments[0];
		var	type = arguments[1];
		var	targetComment =	arguments[2];
		var	elementComment = arguments[3];
		if (targetElementValue == null || targetElementValue ==	"" || type == null || type == "") {
			alert(message.getMessageString('message_229'));
			return false;
		}
		var	date = this.replace(/-/g, '').replace(/:/g,	'').replace(/ /g, '');
		var	targetDate = targetElementValue.replace(/-/g, '').replace(/:/g,	'').replace(/ /g, '');
		if (targetDate.length >	8) {
			targetDate = targetDate.substr(0,8);
		}
		if (type ==	'down')	{
			if (date >=	targetDate)	{
				return true;
			}
			else if	(date <	targetDate)	{
				if (date.length	> 8)
					alert(elementComment + "가 " + targetComment + message.getMessageString('message_289'));
				else
					alert(elementComment + "이 " + targetComment + message.getMessageString('message_289'));
				return false;
			}
			else if	(date == targetDate) {
				if (date.length	> 8)
					alert(elementComment + "가 " + targetComment + message.getMessageString('message_289'));
				else
					alert(elementComment + "이 " + targetComment + message.getMessageString('message_289'));
			}
		}
		if (type ==	'up') {
			if (date > targetDate) {
				if (date.length	> 8)
					alert(elementComment + "가 " + targetComment + message.getMessageString('message_290'));
				else
					alert(elementComment + "이 " + targetComment + message.getMessageString('message_290'));
				return false;
			}
			else if	(date <= targetDate) {
				return true;
			}
			else if	(date == targetDate) {
				if (date.length	> 8)
					alert(elementComment + "가 " + targetComment + message.getMessageString('message_290'));
				else
					alert(elementComment + "이 " + targetComment + message.getMessageString('message_290'));
				return false;
			}
		}
		if (type ==	'timedown')	{

			targetDate = targetElementValue.replace(/-/g, '').replace(/:/g,	'').replace(/ /g, '');
			if (date >=	targetDate)	{
				return true;
			}
			else if	(date <	targetDate)	{
				if (date.length	> 8)
					alert(elementComment + "가 " + targetComment + message.getMessageString('message_289'));
				else
					alert(elementComment + "이 " + targetComment + message.getMessageString('message_289'));
				return false;
			}
			else if	(date == targetDate) {
				if (date.length	> 8)
					alert(elementComment + "가 " + targetComment + message.getMessageString('message_289'));
				else
					alert(elementComment + "이 " + targetComment + message.getMessageString('message_289'));
			}
		}
		if (type ==	'timeup') {

			targetDate = targetElementValue.replace(/-/g, '').replace(/:/g,	'').replace(/ /g, '');
			if (date > targetDate) {
				if (date.length	> 8)
					alert(elementComment + "가 " + targetComment + message.getMessageString('message_290'));
				else
					alert(elementComment + "이 " + targetComment + message.getMessageString('message_290'));
				return false;
			}
			else if	(date <	targetDate)	{
				return true;
			}
			else if	(date == targetDate) {
				if (date.length	> 8)
					alert(elementComment + "가 " + targetComment + message.getMessageString('message_290'));
				else
					alert(elementComment + "이 " + targetComment + message.getMessageString('message_290'));
				return false;
			}
		}
	}

// 동적인 폼 생성을 위한 함수.
// 각 폼속성 및 input 명과 값을(배열) 이용한 동적으로 해당 폼 생성.
// 파라미터	:
//	src	: target url
//	fName :	form name
//	fMethod	: form method
//	fTarget	: form action target
//	attrName[] : input name	array
//	attrValue[]	: input	value array
// 사용법 :
//	createActionForm("src.jsp",	"crForm", "post", "_blank",	attrName[],	attrValue[]);
function createActionForm(src, fName, fMethod, fTarget,	attrName, attrValue) {

	document.write("<form name="+fName+" method="+fMethod+">");

	for	( i=0; i<attrName.length;i++)
		document.write("<input type=hidden name='"+attrName[i]+"' value='"+attrValue[i]+"'>");

	document.write("</form>");

	aForm =	eval(fName);

	aForm.target = fTarget;
	aForm.action = src;
	aForm.submit(true);
}

// 라틴/아시아계 2Byte/캐릭탕 2bit 를 사용하는 문자열의	길이 구함.
// 문자열의	길이 return
// 사용예 :	getStringLength('가나다라마'); ===>	숫자 10	이 리턴됨.
function getStringLength(str) {
	return(str.length+(escape(str)+"%u").match(/%u/g).length-1);
}

// 각 element validation 체크.
// element 에 null 또는	공백 문자열만 입력된 경우 처리.
function formValidate (oForm) {
	for	(var i = 0;	i <	oForm.length; i++) {
		if (getOnlyString(oForm.elements[i].value).length == 0)	{
//			alert (oForm.elements[i].alt + " 값을 입력해 주세요!");
			alert (oForm.elements[i].title + " 값을	입력해 주세요!");
			oForm.elements[i].focus();
			return false;
		}
	}
	return true;
}

// 각 element validation 체크.
// element 에 null 또는	공백 문자열만 입력된 경우 처리.
function fileValidate (oForm) {
	for	(var i = 0;	i <	oForm.length; i++) {
		if (getOnlyString(oForm.elements[i].value).length <	4) {
//			alert (oForm.elements[i].alt + " 파일을 선택해 주세요!");
			alert (oForm.elements[i].title + " 파일을 선택해 주세요!");
			oForm.elements[i].focus();
			return false;
		}
	}
	return true;
}

// 필수요소인 각 element validation	체크.
// element 에 null 또는	공백 문자열만 입력된 경우 처리.
function formNecessaryValidate (oForm) {
	for	(var i = 0;	i <	oForm.length; i++) {
			if (oForm.elements[i].getAttribute("mandatory")	!= null) {
				if (getOnlyString(oForm.elements[i].value).length == 0)	{
//					alert (oForm.elements[i].alt + " 값을 입력해 주세요!");
					alert (oForm.elements[i].title + " 값을	입력해 주세요!");
					oForm.elements[i].focus();
					return false;
				}
			}
	}
	return true;
}

// 문자열에서 공백제거
function getOnlyString(str)
{
	var	index, len;

	// remove the null string
	while(true)	{
		index =	str.indexOf(" ");
		if(	index == -1	) break;
		len	= str.length;
		str	= str.substring(0, index) +	str.substring((index+1),len);
	}

	// remove the carrage return
	while(true)	{
		index =	str.indexOf("\r");
		if(	index == -1	) break;
		len	= str.length;
		str	= str.substring(0, index) +	str.substring((index+2),len);
	}

	return str;
}

// 주어진 문자열에서 알파벳이 하나로도 포함는지	체크
// 단, 한글은 포함안됨.
// 하나라도	포함되는  알파벳이 존재하지	않는 경우 true를 return, 그렇지	않은 경우 false	return.
// 오직	숫자만 입력된 경우 true, 아닌 경우 false
function checkEachChar(checkStr) {

	rValue = true;
	checkNumber	= 0;
	tempStr	= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';

	for	(i=0; i<checkStr.length; i++) {
		for(j=0; j<tempStr.length; j++)	{
			if (checkStr.charAt(i) == tempStr.charAt(j)){
				rValue = false;
				break;
			}
		}
	}

	return rValue;
}

// 문자열이	알파벳으로 구성	되어있는지를 체크.
// 단, 한글은 포함안됨.
// 전부	알파벳일 경우 true를 return, 그렇지	않은 경우 false	return.
function checkChar(checkStr) {

	checkNumber	= 0;
	tempStr	= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';

	for	(i=0; i<checkStr.length; i++) {
		for(j=0; j<tempStr.length; j++)	{
			if (checkStr.charAt(i) == tempStr.charAt(j)) checkNumber++;
		}
	}

	if (checkNumber	!= checkStr.length)	return false;
	else	return true;
}

// 문자열이	숫자로 구성	되어있는지를 체크
// 전부	숫자일경우 true를 return, 그렇지 않은 경우 false return.
function checkNumber(checkStr) {

	rValue = false;
	checkNumber=0;
	tempStr	= '0123456789';

	for	(i=0; i<checkStr.length; i++) {
		for(j=0; j<tempStr.length; j++)	{
			if (checkStr.charAt(i) == tempStr.charAt(j))
				checkNumber++;
		}
	}

	if (checkNumber	!= checkStr.length)
		rValue = false;
	else
		rValue = true;

	return rValue;
}

// 문자열 크기 비교
// 해당	문자열 크기가 요청한 크기보다 작으면 true return
function validateSize(str, size) {
	if(	getStringLength(str) < size	) {
		return true;
	} else {
		return false;
	}
}

//숫자키만 입력	할수 있게 함
//사용법    <input type="text" name="" onKeyPress="onlyNumInput(this)" style="ime-mode:disabled;">
//style은 한글키 막는 것
function onlyNumInput(obj){

	if (event.keyCode >= 48	&& event.keyCode <=	57)	{ //숫자키만 입력
		return true;
	} else {
		event.returnValue =	false;
	}
}


// 팝업윈도우1
// 파라미터 1) 팝업윈도우명 2) URL 3) 창 가로크기 4) 창 세로크기
// 사용예 :	popWindow('WIN', 'http://domain', 800, 600);
function popWindow (objName, src, width, height) {
	var	lSize =	( screen.width - width ) / 2;
	var	tSize =	( screen.height	- height ) / 2;

	var	pWin = window.open(	src,
				objName,
				"top="+tSize+",left="+lSize+",status=no,toolbar=no,scrollbars=yes,resizable=yes,menubar=no,width="+width+",height="+height );

	eval(pWin).focus();

	return pWin;
}

// 팝업윈도우2
// 파라미터 1) 팝업윈도우명 2) URL 3) 창 가로크기 4) 창 세로크기 5) 툴바 6) 스크롤바 7) 사이즈조절
// 사용예 :	popWindow('WIN', 'http://domain', 800, 600,	'yes', 'yes', 'yes');
function popWindow (objName, src, width, height, toolbar, scrollbars, resizable) {
	var	lSize =	( screen.width - width ) / 2;
	var	tSize =	( screen.height	- height ) / 2;

	var	pWin = window.open(	src,
				objName,
				"top="+tSize+",left="+lSize+",status=no,toolbar="+toolbar+",scrollbars="+scrollbars+",resizable="+resizable+",menubar=no,width="+width+",height="+height );

	eval(pWin).focus();

	return pWin;
}

// 팝업윈도우2
// 파라미터 0) 오프너윈도우의 폼객체명 1) 팝업윈도우명 2) URL 3) 창 가로크기 4) 창 세로크기 5) 툴바 6) 스크롤바 7) 사이즈조절
// 사용예 :	popWindowSubmit('WIN', 'http://domain',	800, 600, 'yes', 'yes',	'yes');
function popWindowSubmit (form,	objName, src, width, height, toolbar, scrollbars, resizable) {
	var	lSize =	( screen.width - width ) / 2;
	var	tSize =	( screen.height	- height ) / 2;

	var	wmd	= window.open( "",
				objName,
				"top="+tSize+",left="+lSize+",status=no,toolbar="+toolbar+",scrollbars="+scrollbars+",resizable="+resizable+",menubar=no,width="+width+",height="+height );
//	alert("status=no; dialogWidth :" + width + "px;	dialogHeight:" + height	+"px;");
//	var	wmd	= window.showModalDialog( src,
//				window,
//				"status=no;	dialogWidth	:" + width + "px; dialogHeight:" + height +"px;");

	var	prevTarget = form.target;
	form.target	= objName;
	form.action	= src;
	form.submit();
	form.target	= prevTarget;

	eval(wmd).focus();

	return wmd;
}

// 문자열에	quot(',	")가 있는지	체크.
// quot가 없을경우 true를 return, 그렇지 않은 경우 false return.
function checkQuotChar(checkStr) {
	if ( checkStr == ""	) return true;

	result = true;

	quot = '"';
	apos = "'";

	if ( isNull(checkStr) )	alert (	"'checkStr'	Values is NULL OR EMPTY!");

	for	(i=0; i<checkStr.length; i++) {
		if (checkStr.charAt(i) == quot)	{
			result = false;
			break;
		}
		if (checkStr.charAt(i) == apos)	{
			result = false;
			break;
		}
	}

	return result;
}

// 문자열에	특수문자가 있는지 체크.
// 특수문자가 없을경우 true를 return, 그렇지 않은 경우 false return.
function checkSpecialChar(checkStr)	{
	if ( checkStr == ""	) return true;
	tempStr	= '~`!@#$%^&*()_-+=|\\{}[]:;\'\"<>,.?/';

	if ( isNull(checkStr) )	alert (	"'checkStr'	Values is NULL OR EMPTY!");

	for	(i=0; i<checkStr.length; i++) {
		for(j=0; j<tempStr.length; j++)	{
			if (checkStr.charAt(i) == tempStr.charAt(j))
				return false;
		}
	}

	return true;
}

// 문자열에	특수문자가 변환.
// 특수문자를 모두 변환 한 스트링 반환
function convertSC(str)	{
	//special character	&’‘"ⓒ÷½¼¾μ®§­¹²³ß×<>'

	str	= str.replace(/&/g,	"&amp;");
//	str	= str.replace(/’/g,	"&lsquo;");
//	str	= str.replace(/‘/g,	"&quot;");
	str	= str.replace(/"/g,	"&rsquo;");
//	str	= str.replace(/ⓒ/g, "&copy;");
//	str	= str.replace(/÷/g,	"&divide;");
//	str	= str.replace(/½/g,	"&frac12;");
//	str	= str.replace(/¼/g,	"&frac14;");
//	str	= str.replace(/¾/g,	"&frac34;");
//	str	= str.replace(/μ/g,	"&micro;");
//	str	= str.replace(/®/g,	"&reg;");
//	str	= str.replace(/§/g,	"&sect;");
	str	= str.replace(/-/g,	"&shy;");
//	str	= str.replace(/¹/g,	"&sup1;");
//	str	= str.replace(/²/g,	"&sup2;");
//	str	= str.replace(/³/g,	"&sup3;");
//	str	= str.replace(/ß/g,	"&szlig;");
//	str	= str.replace(/×/g,	"&times;");
	str	= str.replace(/</g,	"&lt;");
	str	= str.replace(/>/g,	"&gt;");
	str	= str.replace(/'/g,	"&#39;");

	return str;
}

// 숫자	비교.
// 대상숫자가 min,max 사이값인지 검사.
// if min value null, alert 'max 값보다 작아야합니다', return false
// if max value null, alert 'min 값보다 커야 합니다', return false
// if min, max value exist,	check
// -> if min < num max,	return true
// -> if min > num or max >	num, return	false
function checkInterval(obj,	min, max) {
	num	= obj.value;

	if ( isNaO(max)	&& isNaO(min) )	{
		alert(min +	","	+ max +	" 잘못된 비교 입니다");
		return false;
	} else if (	isNaO(min) ) {
		alert(max+" 보다 작아야 합니다");
		return false;
	} else if (isNaO(max) )	{
		alert(min+"	보다 커야 합니다");
		return false;
	} else if (	compare(num, min) && compare(max, num) ) {
		return true;
	} else {
//		alert(obj.alt + " 값을 " + min + "과 " + max + "사이 값으로 입력해주세요");
		alert(obj.title	+ "	값을 " + min + "과 " + max + "사이 값으로 입력해주세요");
		obj.focus();
		return false;
	}
}

// compare
function compare(seed, tnum) {
	if ( seed >= tnum )	return true;
}

// is Null a Object
// OBJECT or VALUE NULL	체크
// null이 아니면 true, null이면	false return;
function isNaO ( obj ) {
	isValid	= true;
	if ( obj !=	null &&	obj	!= "null" )
		isValid	= false;
	return isValid;
}

function check_jumin(input,	input2)	{

	var	p_no	= new Array(13);
	var	preg1	= input.value;
	var	preg2	= input2.value;
	var	last_id, no_mod, no_minus, no_last;

	if (preg1.length !=6) {
		alert('주민등록번호	앞번호 6자리를 입력하세요.');
		input.focus();
		input.select();
		return false;
	}

	if (preg2.length !=7) {
	   alert('주민등록번호 뒷번호 7자리를 입력하세요.');
		input2.focus();
		input2.select();
		return false;
	}
	if (!((preg2.substring(0,1)	== '1')	|| (preg2.substring(0,1) ==	'2') ||	(preg2.substring(0,1) == '3') || (preg2.substring(0,1) == '4'))) {
		alert('주민등록번호	뒷자리를 맞게 입력 해주세요.');
		input2.focus();
		input2.select();
		return false;
	}

	last_id		= parseInt(preg2.substring(6,7));
	p_no[0]		= parseInt(preg1.substring(0,1)) * 2;
	p_no[1]		= parseInt(preg1.substring(1,2)) * 3;
	p_no[2]		= parseInt(preg1.substring(2,3)) * 4;
	p_no[3]		= parseInt(preg1.substring(3,4)) * 5;
	p_no[4]		= parseInt(preg1.substring(4,5)) * 6;
	p_no[5]		= parseInt(preg1.substring(5,6)) * 7;
	p_no[6]		= parseInt(preg2.substring(0,1)) * 8;
	p_no[7]		= parseInt(preg2.substring(1,2)) * 9;
	p_no[8]		= parseInt(preg2.substring(2,3)) * 2;
	p_no[9]		= parseInt(preg2.substring(3,4)) * 3;
	p_no[10]	= parseInt(preg2.substring(4,5)) * 4;
	p_no[11]	= parseInt(preg2.substring(5,6)) * 5;
	p_no[12]	= 0;

	for	(var i	= 0; i < 12; i++) {
		p_no[12] = p_no[12]	+ p_no[i];
	}
	no_mod		= p_no[12] % 11;
	no_minus	= 11 - no_mod;
	no_last		= no_minus % 10;

	if (no_last	!= last_id)	{
		alert('주민등록번호가 맞지않습니다.');
		input.focus();
		input.select();
		return false;
	}

	return true;
}

// 월을	저장하기위한 배열
var	mArray = new Array(11);
// 1월부터 12월까지	월 생성
for	( i=1 ;	i<13 ; i++)	mArray[i-1]	= i;

//date object
var	dateObj	= new Date();

//현재 연도를 기본으로 설정
var	selectedYear = dateObj.getYear();
var	selectedMonth =	1;

//월별 마지막 날짜 저장을 위함.(윤달/윤년 고려)
var	monthDays;
monthDays =	new	montharr(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

// 윤달/윤년 마지막날 체크를 위한 루틴
function convertDayByMonth (checkYear, checkMonth) {
	if (((checkYear	% 4	== 0) && (checkYear	% 100 != 0)) ||	(checkYear % 400 ==	0))
		monthDays[1] = 29;
}

//선택한 연도 저장.
function selectCurrentYear(ySelectTag) {
	selectedYear = ySelectTag.options[ySelectTag.selectedIndex].value;
}

//선택한 월 에 따른 일자 표시.
function selectCurrentMonth(mSelectTag,	dayTag)	{

	//선택한 월을 저장.
	selectedMonth =	mSelectTag.options[mSelectTag.selectedIndex].value;

	//선택한 월별 마지막 날짜 반영을 위한 호출.
	convertDayByMonth(selectedYear,	selectedMonth);

	//월별 일 display
	displayDay(dayTag);
}

// 월별	날짜 인스턴스
function montharr(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11)	{
   this[0] = m0;
   this[1] = m1;
   this[2] = m2;
   this[3] = m3;
   this[4] = m4;
   this[5] = m5;
   this[6] = m6;
   this[7] = m7;
   this[8] = m8;
   this[9] = m9;
   this[10]	= m10;
   this[11]	= m11;
}


// 단순	submit를 위한 자바스크립트 함수
// form_name : form	명
// cmd : action	명
// valid : submit 이전 유효성 검사 여부
function doSubmit(form_name, cmd, valid, userFunction, target)
{
	targetForm = $(	form_name);
	if(	valid == true) {
		if(	validUtil.onSubmit(	form_name))	{
			if (userFunction !=	null &&	userFunction !=	undefined) {
				if (!userFunction())
				{
					return true;
				}
			}
			targetForm.action =	cmd;
			if (target !=  null) {
				targetForm.target =	target;
			}
			targetForm.submit();

			return true;
		}
		else {
			return false;
		}
	}
	else {
		if (userFunction !=	null &&	userFunction !=	undefined) {
			if (!userFunction())
			{
				return true;
			}
		}

		targetForm.action =	cmd;
		if (target !=  null) {
			targetForm.target =	target;
		}
		targetForm.submit();

		return true;
	}
}

function doFormSubmit( form, valid,	options, userFunction){

	if(	valid){
		if(	!validUtil.onSubmit( form))
			return false;
	}

	if (userFunction !=	null &&	userFunction !=	undefined) {
		if ( !userFunction()) {
			return false;
		}
	}

	form = $( form);

	if(	options){
		if(	options.action){
			form.setAttribute( "action", options.action);
		}
		//if( options.method){
			form['method'].value = options.method || '';
		//}
		if(	options.target){
			form.setAttribute( "target", options.target);
		}
	}

	form.submit();
}

// 단순	submit를 위한 자바스크립트 함수
// form_name : form	명
// cmd : action	명
// valid : submit 이전 유효성 검사 여부
function doSubmitDwr(form_name,	valid, userFunction) {
	if(	valid == true) {
		if(	validUtil.onSubmit(	form_name))	{
			if (userFunction !=	null &&	userFunction !=	undefined) {
				if ( !userFunction())
				{
					return false;
				}
			}
			return true;
		}
	}
	else {
		if (userFunction !=	null &&	userFunction !=	undefined) {
			if ( !userFunction())
			{
				return false;
			}
		}
		return true;
	}
	return false;
}

// 주어진 url 뒤에 xid 값을 parameter로 추가한 url 을 리턴한다.
function getXURL( url)
{
	return appendParameter(	url, "xid",	getXID());
}

// unique 한 id	를 얻어낸다.
function getXID()
{
	return new Date().getTime();
}

// url에 파라메터를 붙이는 함수
function appendParameter( url, key,	value) {
	var	separator =	'';

	if(url == '') return url;
	if(key == '') return url;
	if(value ==	'')	return url;

	if ( url.indexOf('?') <	0) {
		separator =	'?';
	}
	else if	( (	url.charAt(	url.length-1) != '?') && (url.charAt( url.length-1)	!= '&')) {
		separator =	'&';
	}

	return url + separator + key + '=' + value;
}

function resizeIF(Id) {
	var	obj	= document.getElementById(Id);
	var	Body;
	var	H, Min;

	// 최소	높이 설정 (너무	작아지는 것을 방지)
	Min	= 100;
	// DOM 객체	할당
	try
	{
		if (!document.all && obj.contentWindow.document.location.href == 'about:blank')	{
				setTimeout("resizeIF('"+Id+"')", 10);
				return;
		}

		Body = obj.contentWindow.document.getElementsByTagName('BODY');
		Body = Body[0];

		if (this.Location != obj.contentWindow.document.location.href || this.Height !=	Body.scrollHeight) {
			   // alert(Body.scrollHeight);
				H =	Body.scrollHeight +	5;
				obj.style.height = (H<Min?Min:H) + 'px';
				this.Location =	obj.contentWindow.document.location.href;
				this.Height	= Body.scrollHeight;
		}
	}
	catch(e)
	{
			setTimeout("resizeIF('"+Id+"')", 10);
			return;
	}
	setTimeout("resizeIF('"+Id+"')", 100);
}

function convertFromBRToNR(_str) {
	var	_temp;
	if ( null != _str && 'undefined' !=	_str ) {
		_temp =	_str.replace(/<BR>/gi, "\r\n");
	} else {
		_temp =	"";
	}
	return _temp;
 }

function setCookie(name, parameters) {
	document.cookie	= name + "=" + (parameters[0] ?	escape(parameters[0]) :	"")	+
	((parameters[1]) ? "; expires="	+ parameters[1].toGMTString() :	"")	+
	((parameters[2]) ? "; path=" + parameters[2] : "") +
	((parameters[3]) ? "; domain=" + parameters[3] : "") +
	((parameters[4]) ? "; secure" :	"");
}

function getCookie(name) {
	var	dc = document.cookie;
	var	prefix = name +	"=";
	var	begin =	dc.indexOf("; "	+ prefix);
	if (begin == -1) {
		begin =	dc.indexOf(prefix);
		if (begin != 0)	return null;
	} else {
		begin += 2;
	}
	var	end	= document.cookie.indexOf(";", begin);
	if (end	== -1) {
		end	= dc.length;
	}

	return unescape(dc.substring(begin + prefix.length,	end));
}

function encodeURLString( szInput)
{
	var	szResult = szInput;

	szResult = replace(	szResult, "%", "%25");
	szResult = replace(	szResult, "&", "%26");
	szResult = replace(	szResult, "?", "%3F");
	szResult = replace(	szResult, "=", "%3D");
	szResult = replace(	szResult, "/", "%2F");
	szResult = replace(	szResult, "\n",	"%0A");

	return szResult;
}
function replace(Str, srcStr, tgtStr)
{
	var	ret	= "";
	var	idx	= 0;
	var	idx2 = 1;
	while(idx2 > -1){
		idx2 = Str.indexOf(srcStr, idx);
		if(idx2	< 0){
			ret	+= Str.substring(idx);
			break;
		}
		ret	+= Str.substring(idx, idx2);
		ret	+= tgtStr;
		idx	= idx2+1;
	}
	return ret;
}
function replaceHtml(el, html) {
		var	oldEl =	(typeof	el === "string"	? document.getElementById(el) :	el);
		var	newEl =	document.createElement(oldEl.nodeName);
		// Preserve	the	element's id and class (other properties are lost)
		newEl.id = oldEl.id;
		newEl.className	= oldEl.className;
		// Replace the old with	the	new
		newEl.innerHTML	= html;
		oldEl.parentNode.replaceChild(newEl, oldEl);
		/* Since we	just removed the old element from the DOM, return a	reference
		to the new element,	which can be used to restore variable references. */
		return newEl;
};
function RunTimer(){
		 var today = new Date()	   // 현재시간 얻기
		 var RunTime = today.getTime();	// 밀리초 from 1/1/70
		 return	RunTime;
}
var	StartTime;
var	EndTime;
function startTimer() {
	StartTime=RunTimer();
}
function endTimer()	{
	EndTime=RunTimer();
	alert((EndTime-StartTime)/1000);
}

function getLastDayOfMonth(date)
{
	var	daysOfMonth	= new Array(31,	28,	31,	30,	31,	30,	31,	31,	30,	31,	30,	31);
	var	dateArr		= date.split("-");
	var	year		= dateArr[0];
	var	month		= dateArr[1] - 1;

	if ( year %	4 == 0 )
		daysOfMonth[1] = 29;
	if ( year %	100	== 0 )
		daysOfMonth[1] = 28;
	if ( year %	400	== 0 )
		daysOfMonth[1] = 29;

	return daysOfMonth[month];
}

function MM_swapImgRestore() { //v3.0
	var	i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
		x.src=x.oSrc;
}

function MM_preloadImages()	{ //v3.0
	var	d=document;
	if(d.images){
		if(!d.MM_p)	d.MM_p=new Array();
		var	i,j=d.MM_p.length,a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0){
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
		}
}

function MM_findObj(n, d) {	//v4.01
	var	p,i,x;

	if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all)
		x=d.all[n];
	for	(i=0;!x&&i<d.forms.length;i++)
		x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++)
		x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById)
		x=d.getElementById(n);

	return x;
}

function MM_swapImage()	{ //v3.0
	var	i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null){
			document.MM_sr[j++]=x;
			if(!x.oSrc)
				x.oSrc=x.src;
			x.src=a[i+2];
		}
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0;	i<(args.length-2); i+=3)
  with (document) if (getElementById &&	((obj=getElementById(args[i]))!=null)) { v=args[i+2];
	if (obj.style) { obj=obj.style;	v=(v=='show')?'visible':(v=='hide')?'hidden':v;	}
	obj.visibility=v; }
}

// flashWrite(파일경로,	가로, 세로,	아이디,	배경색,	변수, 윈도우모드)
function inputSWF(url,w,h,id,vars,win){
	win	= win || "transparent";

	// 플래시 코드 정의
	var	flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"'	id='"+id+"'	align='middle'>"+
	"<param	name='allowScriptAccess' value='always'	/>"+
	"<param	name='movie' value='"+url+"' />"+
	"<param	name='FlashVars' value='"+vars+"' />"+
	"<param	name='wmode' value='"+win+"' />"+
	"<param	name='menu'	value='false' />"+
	"<param	name='quality' value='high'	/>"+
	"<embed	src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false'	quality='high' width='"+w+"' height='"+h+"'	name='"+id+"' align='middle' allowScriptAccess='always'	type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	// 플래시 코드 출력

	document.write(flashStr);
}

var	message	= {
	getMessageString : function(messageCode) {
		messageCode	+= '';
		var	result = ' 해당	코드가 없습니다.';
		if (!messageString.containsKey(messageCode)) {
			return result;
		}
		var	size = messageString.keys();
		try	{
			result = messageString.get(messageCode);
		}
		catch (e) {}
		return result.replace(//g,	'');
	}
}

function goMenuSubmit(form_name, element) {
	var	menuUrl	= element.getAttribute("menuUrl");
	var	parameter =	element.getAttribute("parameter");
	var	menuSeq = element.getAttribute("menuSeq");
	var	method = element.getAttribute("method");
	var	html = '';
	
	if (parameter != null && parameter != '' && parameter != undefined) {
		var	paramList =	parameter.split(",");
		for	(var i = 0 ; i < paramList.length ;	i++) {
			var	param =	paramList[i].split("=");
			html +=	'<input	type="hidden" id="'	+ param[0] +'" name="' + param[0] +'" value="' + param[1] +'" />';
		}
	}
	if (method != null && method !=	undefined)
		html +=	'<input	type="hidden" id="method" name="method"	value="' + method +'" />';
	if (menuSeq != null && menuSeq !=	undefined)
		html +=	'<input	type="hidden" id="menuSeq" name="menuSeq"	value="' + menuSeq +'" />';
	if (html != '')
		form_name.innerHTML	= html;
		
	doFormSubmit( form_name, false,	{ action: menuUrl});

//	var map = new JMap();
//	map.put("parameter", parameter);
//	map.put("menuSeq", menuSeq);
//		
//	dwrUtil.invokeMap( map.toMap(), { beanId: "adm.menuLinkDWR", method: "menuLink"});	
}

function getPageSize(){

	var	xScroll, yScroll;

	if (window.innerHeight != undefined	&& window.scrollMaxY !=	undefined) {
		xScroll	= window.innerWidth	+ window.scrollMaxX;
		yScroll	= window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight >	document.body.offsetHeight){ //	all	but	Explorer Mac
		xScroll	= document.body.scrollWidth;
		yScroll	= document.body.scrollHeight;
	} else { //	Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll	= document.body.offsetWidth;
		yScroll	= document.body.offsetHeight;
	}

	var	windowWidth, windowHeight;

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth	= document.documentElement.clientWidth;
		} else {
			windowWidth	= self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement	&& document.documentElement.clientHeight) {	// Explorer	6 Strict Mode
		windowWidth	= document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) {	// other Explorers
		windowWidth	= document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with	total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with	total width	less then width	of the viewport
	if(xScroll < windowWidth){
		pageWidth =	xScroll;
	} else {
		pageWidth =	windowWidth;
	}

	arrayPageSize =	new	Array(xScroll,yScroll,windowWidth,windowHeight)
//	  arrayPageSize	= new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}

function popCalendar( imgObject, inputObject, dateType,	loc, path){
	if(	loc	== parent){
		if(	parent.calendar) {
			parent.divClick	= true;
			parent.calendar.inputWindow	= window;
			parent.calendar.service( imgObject,	inputObject, dateType, path);
		}
	}
	else if( calendar) {
		divClick = true;
		calendar.inputWindow = window;
		calendar.service( imgObject, inputObject, dateType,	path);
	}
}

function popZipcodeSearch( setName,	setValue, userFunction)	{
	var	input =	[
		"setName=" + setName.join(','),
		"setValue="	+ setValue.join(',')
	];
	var	btn	= [
		{ type : 3 }
	];

	mybox.service( "/common/sch/zipcodeSearch.do",'우편번호	검색','500','600', 4, input, userFunction, btn);
}

function popOrgSearch( setName,	setValue, userFunction)	{
	var	input =	[
		"setName=" + setName.join(','),
		"setValue="	+ setValue.join(',')
	];
	var	btn	= [
		{ type : 3 }
	];

	mybox.service( "/common/sch/orgSearch.do",'기관	검색','500','600', 4, input, userFunction, btn);
}

function goHome() {
	if (parent != null)
		parent.location.href=context;
}

var	goBackUtil = {
	param :	new	JMap(),
	doReserveParams	: function(	url, params) {
		if(	url	&& params) {
			return parent.goBackUtil.doReserve(	url, params);
		}
	},
	doReserve :	function( url, params) {
		this.param.put(	url, params);

		return this.param.containsKey( url);
	},
	doSetParams	: function(	url, form) {
		params = parent.goBackUtil.doGetParams(	url);
		if(	params)	{
			form = $( form);

			for( var key in	params)	{
				if(	form[key])
					form[key].value	= params[key];
				else
					Insertion.Bottom( form,	'<input	type="hidden" id="'	+ key +	'" name="' + key + '" value="' + params[key] + '" />');
			}

			return true;
		}
	},
	doGetParams	: function(	url) {
		return this.param.get( url);
	}
}
function $RF(el, radioGroup) {
    if($(el).type && $(el).type.toLowerCase() == 'radio') {
        var radioGroup = $(el).name;
        var el = $(el).form;
    } else if ($(el).tagName.toLowerCase() != 'form') {
        return false;
    }
 
    var checked = $(el).getInputs('radio', radioGroup).find(
        function(re) {return re.checked;}
    );
    return (checked) ? $F(checked) : null;
}
